Salome HOME
Merge from V5_1_3_BR 07/12/2009
authorvsr <vsr@opencascade.com>
Mon, 7 Dec 2009 14:51:20 +0000 (14:51 +0000)
committervsr <vsr@opencascade.com>
Mon, 7 Dec 2009 14:51:20 +0000 (14:51 +0000)
15 files changed:
src/Basics/Basics_DirUtils.cxx
src/Basics/Basics_Utils.cxx
src/Basics/Basics_Utils.hxx
src/KERNEL_PY/salome_test.py
src/LifeCycleCORBA/SALOME_FileTransferCORBA.cxx
src/ModuleCatalog/SALOME_ModuleCatalog_Server.cxx
src/ModuleCatalog/SALOME_ModuleCatalog_impl.cxx
src/NamingService/SALOME_NamingService.cxx
src/ResourcesManager/SALOME_ResourcesCatalog_Handler.cxx
src/SALOMEDS/SALOME_DriverPy.py
src/SALOMEDSImpl/SALOMEDSImpl_AttributeIOR.cxx
src/SALOMEDSImpl/SALOMEDSImpl_IParameters.cxx
src/SALOMEDSImpl/SALOMEDSImpl_ScalarVariable.cxx
src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx
src/SALOMELocalTrace/LocalTraceBufferPool.cxx

index e1682301f4d0c308c54026a479121e80daccd8c3..613368ba06d3063051b83b4ecf23cd565d602429 100644 (file)
@@ -24,7 +24,7 @@
 //  Module : SALOME
 //
 #include "Basics_DirUtils.hxx"
-
+#include <stdio.h>
 #include <errno.h>
 #include <stdlib.h>
 
index 10a12b74a66c82c3e42e64f5e573d0fb86ddc921..3be1e68c2721427a229add1cfe8f6cf43dc08021 100644 (file)
@@ -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());
+  }
 }
index ed99361c7036da6fc63ce6488364b290fd46c620..7ca83964a81a3bfe12b58367f3d3b772df3fbaf2 100644 (file)
 namespace Kernel_Utils
 {
   BASICS_EXPORT std::string GetHostname();
+
+  class BASICS_EXPORT Localizer
+  {
+  public:
+    Localizer();
+    ~Localizer();
+  private:
+    std::string myCurLocale;
+  };
 }
 
 #endif //_Basics_UTILS_HXX_
index c0818f45ff590335c2c24e70e46826fad77d7846..697feb2cf4ac8a373dc81e51fa218faff20ed08d 100755 (executable)
@@ -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:
index 26e08da5640e655d01c75e6852ec5820c0e8ccab..4601dce6f02b640114c5b72122b4cae8127252b4 100644 (file)
@@ -28,6 +28,7 @@
 #include "SALOME_LifeCycleCORBA.hxx"
 #include "utilities.h"
 #include "Basics_Utils.hxx"
+#include <cstdio>
 
 using namespace std;
 
index 43c4b6d8c078b68569d6d49a541bfb69bab7d2c2..9e5912f34e24920d6485d27d51ca13a612f0bdb8 100644 (file)
@@ -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;
 }
index 86563570585678e2eefe6fe48bdf79b73c6eeb3b..621b34c03ef4ecaa9a650d7e7e33fa2aa000fb4e 100644 (file)
@@ -27,6 +27,7 @@
 //
 #include "SALOME_ModuleCatalog_impl.hxx"
 #include "SALOME_ModuleCatalog_Acomponent_impl.hxx"
+#include <libxml/parser.h>
 #include <fstream>
 #include <map>
 #include "utilities.h"
@@ -79,6 +80,8 @@ list<string> 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 "<<file);
 
       xmlFreeDoc(aDoc);
-      xmlCleanupParser();
       fclose(aFile);
     }
   else
index 70d337008f190dc5fe79c3599db7a518e6c35ba4..ece4ca55a46f4f2b419a0f5ef4aaaa190325d8c3 100644 (file)
@@ -33,6 +33,7 @@
 #include <iostream>
 #include <cstring>
 #include <string>
+#include <cstdio>
 
 using namespace std;
 
index 4234cda85e3162dacf7a25ce2f6c9518aac7d22f..d4f5d269b5284e2aef6e7193236d5c2d5276f543 100755 (executable)
@@ -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;
index 87da46bd2645862f1946f4f24845fb9ef8269a73..c76d4c9bd3cfe1e05507fe559008a8fdbc877500 100644 (file)
@@ -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):
index 1c049a87f27a81022b917fb70e4174066ef13ac2..965c832392886f04012f47a5c7c63c12fde9f9ed 100644 (file)
@@ -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"
index 6d4c990827445f1585766e4678bd44522f4e27b8..ff5cae5583f33dd967751fad32311c10ce02bd96 100644 (file)
@@ -284,7 +284,6 @@ string SALOMEDSImpl_IParameters::getStudyScript(SALOMEDSImpl_Study* study, int s
       vector<string> 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
index d40db227c7cb91b75de9e62ef8ea403a10bc0b37..73803b063078da92aea053eae4635bb0a3091c61 100644 (file)
@@ -25,6 +25,7 @@
 #include "SALOMEDSImpl_GenericVariable.hxx"
 #include <iostream>
 #include <cstdlib>
+#include <cstdio>
 
 using namespace std;
 
index 373058472710933333441384371f53071930159a..2b24641addadc8c02385029e1e06ccd4373eaeeb 100644 (file)
@@ -28,6 +28,8 @@
 
 using namespace std;
 
+#include <Basics_Utils.hxx>
+
 #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";
index 1b384dc37425196ef6f58ea203ca03aa1f348371..ac1712a44c9b798f121d033cc693797e734a7462 100644 (file)
@@ -28,6 +28,7 @@
 #include <limits.h>
 #include <cassert>
 #include <string.h>
+#include <cstdio>
 
 #ifndef WIN32
 #include <dlfcn.h>