From: mpa Date: Tue, 17 Jan 2017 09:14:56 +0000 (+0300) Subject: Delete multi-study related code X-Git-Tag: Before_python3_27062017~1^2~9 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=6fcebbb5046b69547c6e8cefd980efdc655cebad;p=modules%2Fkernel.git Delete multi-study related code --- diff --git a/bin/runIDLparser b/bin/runIDLparser index c13e39b12..f3c8df9f1 100644 --- a/bin/runIDLparser +++ b/bin/runIDLparser @@ -43,7 +43,7 @@ if test "$hh" = "1" ; then echo "" echo " to run IDLparser:" echo "" - echo " $0 -Wbcatalog=[,icon=][,version=][,author=][,name=][,multistudy=][,remove=component_name] " + echo " $0 -Wbcatalog=[,icon=][,version=][,author=][,name=][,remove=component_name] " echo "" echo " to have omniidl help:" echo "" diff --git a/idl/SALOMEDS.idl b/idl/SALOMEDS.idl index e300df269..d43d58e83 100644 --- a/idl/SALOMEDS.idl +++ b/idl/SALOMEDS.idl @@ -55,8 +55,6 @@ module SALOMEDS */ typedef string SalomeReference; -//! List of file names - typedef sequence ListOfFileNames; //! List of modification dates of a study typedef sequence ListOfDates ; //! An unbounded sequence of strings diff --git a/idl/SALOME_ModuleCatalog.idl b/idl/SALOME_ModuleCatalog.idl index 78439ffe3..9aa6c6164 100644 --- a/idl/SALOME_ModuleCatalog.idl +++ b/idl/SALOME_ModuleCatalog.idl @@ -166,7 +166,6 @@ a path to a component ComponentType type; string name; string username; - boolean multistudy; ImplType implementationType; string implname; string icon; @@ -269,10 +268,6 @@ a path to a component */ readonly attribute string componentusername; -/*! \brief Get whether the component is multistudy or not -*/ - readonly attribute boolean multistudy; - /*! \brief Get the type of the component */ readonly attribute ComponentType component_type ; diff --git a/idl/SALOME_Session.idl b/idl/SALOME_Session.idl index 8f1957446..fc26d2d47 100644 --- a/idl/SALOME_Session.idl +++ b/idl/SALOME_Session.idl @@ -54,8 +54,7 @@ module SALOME -# running : one or more running studies */ SessionState state ; - //! Number of running studies - short runningStudies ; + //! It is True if GUI is active in the session boolean activeGUI ; } ; @@ -70,8 +69,8 @@ module SALOME { //! This exception is raised when trying to stop the %session with active GUI exception GUIActive {} ; -//! This exception is raised when trying to stop the %session with a number of running studies. - exception RunningStudies {} ; +//! This exception is raised when trying to stop the %session with running study. + exception RunningStudy {} ; //! Launches GUI in the session void GetInterface(); @@ -80,7 +79,7 @@ module SALOME Engines::EngineComponent GetComponent(in string theLibraryName); //! Stops the %Session (It must be idle) - void StopSession() raises(GUIActive, RunningStudies) ; + void StopSession() raises(GUIActive, RunningStudy) ; //! Gets Session State StatSession GetStatSession() ; diff --git a/resources/KERNELCatalog.xml.in b/resources/KERNELCatalog.xml.in index 5648c41fd..3a87aadde 100644 --- a/resources/KERNELCatalog.xml.in +++ b/resources/KERNELCatalog.xml.in @@ -77,7 +77,6 @@ NRI @SALOMEKERNEL_VERSION@ GUI Neutral Context - 1 hostname = muna @@ -88,7 +87,6 @@ NRI @SALOMEKERNEL_VERSION@ GUI Neutral Context - 1 'linux' ~ OS @@ -98,7 +96,6 @@ NRI @SALOMEKERNEL_VERSION@ GUI Neutral Context - 1 'linux' ~ OS diff --git a/src/Container/Component_i.cxx b/src/Container/Component_i.cxx index 6b4676f05..7dda9bdab 100644 --- a/src/Container/Component_i.cxx +++ b/src/Container/Component_i.cxx @@ -51,7 +51,6 @@ int SIGUSR11 = 1000; extern bool _Sleeping ; static Engines_Component_i * theEngines_Component ; -bool Engines_Component_i::_isMultiStudy = false; bool Engines_Component_i::_isMultiInstance = false; /*! \class Engines_Component_i diff --git a/src/Container/SALOME_Component_i.hxx b/src/Container/SALOME_Component_i.hxx index ca1f7cf4f..4235f5048 100644 --- a/src/Container/SALOME_Component_i.hxx +++ b/src/Container/SALOME_Component_i.hxx @@ -128,7 +128,6 @@ public: std::string getContainerName(); void setContainerName(); - static bool isMultiStudy(); static bool isMultiInstance(); static std::string GetDynLibraryName(const char *componentName); @@ -147,7 +146,6 @@ public: Salome_file_i * file); protected: - static bool _isMultiStudy; static bool _isMultiInstance; std::string _instanceName ; diff --git a/src/ModuleCatalog/SALOME_ModuleCatalog_Acomponent_impl.cxx b/src/ModuleCatalog/SALOME_ModuleCatalog_Acomponent_impl.cxx index 9d8408d86..240d60a8a 100644 --- a/src/ModuleCatalog/SALOME_ModuleCatalog_Acomponent_impl.cxx +++ b/src/ModuleCatalog/SALOME_ModuleCatalog_Acomponent_impl.cxx @@ -42,8 +42,7 @@ static int MYDEBUG = 0; //---------------------------------------------------------------------- // Function : SALOME_ModuleCatalog_AcomponentImpl // Purpose : Constructor -// Affect the component name, type,icone, a bool to define -// if it's multistudy or not. +// Affect the component name, type,icone // Affect too the constraint and the interfaces of the component // and the pathes prefixes for all computers //---------------------------------------------------------------------- @@ -399,16 +398,6 @@ char* SALOME_ModuleCatalog_AcomponentImpl::componentusername() return CORBA::string_dup(_Component.username); } -//---------------------------------------------------------------------- -// Function : multistudy -// Purpose : define if a component can be multistudy or not -//---------------------------------------------------------------------- -CORBA::Boolean SALOME_ModuleCatalog_AcomponentImpl::multistudy() -{ - return _Component.multistudy ; -} - - //---------------------------------------------------------------------- // Function : implementation type // Purpose : return the implementation type : C++ (dyn lib), Python (module) or executable diff --git a/src/ModuleCatalog/SALOME_ModuleCatalog_Acomponent_impl.hxx b/src/ModuleCatalog/SALOME_ModuleCatalog_Acomponent_impl.hxx index 5078c95f4..d84bd08da 100644 --- a/src/ModuleCatalog/SALOME_ModuleCatalog_Acomponent_impl.hxx +++ b/src/ModuleCatalog/SALOME_ModuleCatalog_Acomponent_impl.hxx @@ -121,12 +121,6 @@ public: */ virtual char* componentusername(); - //! method to define if a component can be multistudy or not - /*! - \return true if the component supports multistudy - */ - virtual CORBA::Boolean multistudy(); - //! method to define the type of the component /*! \return the component type diff --git a/src/ModuleCatalog/SALOME_ModuleCatalog_Client.cxx b/src/ModuleCatalog/SALOME_ModuleCatalog_Client.cxx index 8ed79652e..858cc45a7 100644 --- a/src/ModuleCatalog/SALOME_ModuleCatalog_Client.cxx +++ b/src/ModuleCatalog/SALOME_ModuleCatalog_Client.cxx @@ -152,7 +152,6 @@ int main(int argc,char **argv) void PrintComponent(SALOME_ModuleCatalog::Acomponent_ptr C) { MESSAGE("Name : " << C->componentname()); - MESSAGE("Type : " << C->component_type() << " multistudy : " << C->multistudy()); MESSAGE("Constraint : " << C->constraint()); MESSAGE("Icon : " << C->component_icone()); diff --git a/src/ModuleCatalog/SALOME_ModuleCatalog_Handler.cxx b/src/ModuleCatalog/SALOME_ModuleCatalog_Handler.cxx index 32f628dee..bc7206822 100644 --- a/src/ModuleCatalog/SALOME_ModuleCatalog_Handler.cxx +++ b/src/ModuleCatalog/SALOME_ModuleCatalog_Handler.cxx @@ -64,7 +64,6 @@ SALOME_ModuleCatalog_Handler::SALOME_ModuleCatalog_Handler(ParserPathPrefixes& p test_component_name = "component-name"; test_component_username = "component-username"; test_component_type = "component-type" ; - test_component_multistudy = "component-multistudy"; test_component_icon = "component-icone" ; test_component_impltype = "component-impltype"; test_component_implname = "component-implname"; @@ -477,10 +476,6 @@ void SALOME_ModuleCatalog_Handler::ProcessXmlDocument(xmlDocPtr theDoc) _aModule.type = OTHER ; } - // Tag test_component_multistudy - if ( !xmlStrcmp(aComponentSubNode->name, (const xmlChar*)test_component_multistudy) ) - _aModule.multistudy = atoi( aContent.c_str() ) != 0; - // Tag test_component_impltype if ( !xmlStrcmp(aComponentSubNode->name, (const xmlChar*)test_component_impltype) ) _aModule.implementationType = aContent; diff --git a/src/ModuleCatalog/SALOME_ModuleCatalog_Handler.hxx b/src/ModuleCatalog/SALOME_ModuleCatalog_Handler.hxx index f75ca4ae2..1ad92fab9 100644 --- a/src/ModuleCatalog/SALOME_ModuleCatalog_Handler.hxx +++ b/src/ModuleCatalog/SALOME_ModuleCatalog_Handler.hxx @@ -65,7 +65,6 @@ private: const char *test_component_name; const char *test_component_username; const char *test_component_type ; - const char *test_component_multistudy ; const char *test_component_icon ; const char *test_component_impltype; const char *test_component_implname; diff --git a/src/ModuleCatalog/SALOME_ModuleCatalog_Parser.hxx b/src/ModuleCatalog/SALOME_ModuleCatalog_Parser.hxx index 622af9b9e..9f1e4a6cd 100644 --- a/src/ModuleCatalog/SALOME_ModuleCatalog_Parser.hxx +++ b/src/ModuleCatalog/SALOME_ModuleCatalog_Parser.hxx @@ -91,7 +91,6 @@ struct ParserComponent std::string name; std::string username; ParserComponentType type; - bool multistudy; std::string icon; std::string constraint; ParserInterfaces interfaces; diff --git a/src/ModuleCatalog/SALOME_ModuleCatalog_Parser_IO.cxx b/src/ModuleCatalog/SALOME_ModuleCatalog_Parser_IO.cxx index 29a9f25c2..26f7c7838 100644 --- a/src/ModuleCatalog/SALOME_ModuleCatalog_Parser_IO.cxx +++ b/src/ModuleCatalog/SALOME_ModuleCatalog_Parser_IO.cxx @@ -124,8 +124,6 @@ std::ostream & operator<< (std::ostream & f, << " name : " << C.name << std::endl; f << " user name : " << C.username << std::endl; f << " type : " << C.type << std::endl; - f << " multistudy : " << (C.multistudy ? "yes" : "no") - << std::endl; f << " icon : " << C.icon << std::endl; f << " constraint : " << C.constraint << std::endl; diff --git a/src/ModuleCatalog/SALOME_ModuleCatalog_impl.cxx b/src/ModuleCatalog/SALOME_ModuleCatalog_impl.cxx index 08ab85a2b..b3f6e16f0 100644 --- a/src/ModuleCatalog/SALOME_ModuleCatalog_impl.cxx +++ b/src/ModuleCatalog/SALOME_ModuleCatalog_impl.cxx @@ -897,7 +897,6 @@ void SALOME_ModuleCatalogImpl::Private::duplicate { C_corba.name = CORBA::string_dup(C_parser.name.c_str()); C_corba.username = CORBA::string_dup(C_parser.username.c_str()); - C_corba.multistudy = C_parser.multistudy; C_corba.icon = CORBA::string_dup(C_parser.icon.c_str()); C_corba.type = ComponentTypeConvert[C_parser.type]; if(C_parser.implementationType == "EXE") diff --git a/src/ModuleGenerator/IDLparser.py b/src/ModuleGenerator/IDLparser.py index 0f2ab825d..0d6d9a060 100644 --- a/src/ModuleGenerator/IDLparser.py +++ b/src/ModuleGenerator/IDLparser.py @@ -39,7 +39,6 @@ common_data={"AUTHOR" : "", "COMP_TYPE" : "", "COMP_NAME" : "", "COMP_UNAME" : "", - "COMP_MULT" : "", "COMP_IMPL" : "" } @@ -437,7 +436,6 @@ class Component(Tree): self.addNamedChild('component-author', common_data["AUTHOR"]) self.addNamedChild('component-version', common_data["VERSION"]) self.addNamedChild('component-comment', 'unknown') - self.addNamedChild('component-multistudy', common_data["COMP_MULT"]) self.addNamedChild('component-impltype', common_data["COMP_IMPL"]) self.addNamedChild('component-icone', common_data["ICON"]) self.addNamedChild('constraint') @@ -456,7 +454,7 @@ class Component(Tree): for i in ['component-username', 'component-author', 'component-type', 'component-icone', 'component-version', - 'component-multistudy', 'component-impltype', 'constraint']: + 'component-impltype', 'constraint']: ext = C.getChild(i) int = self.getChild(i) if int is None: @@ -833,7 +831,6 @@ def run(tree, args): common_data["COMP_NAME"] = getParamValue("name", "", args) common_data["COMP_UNAME"] = getParamValue("username", "", args) common_data["COMP_TYPE"] = getParamValue("type", "OTHER", args) - common_data["COMP_MULT"] = getParamValue("multistudy", "1", args) common_data["COMP_IMPL"] = getParamValue("impltype", "1", args) print common_data @@ -882,5 +879,5 @@ def run(tree, args): if __name__ == "__main__": print - print "Usage : omniidl -bIDLparser [-I]* -Wbcatalog=[,icon=][,version=][,author=][,name=][,username=][,multistudy=][,impltype=] " + print "Usage : omniidl -bIDLparser [-I]* -Wbcatalog=[,icon=][,version=][,author=][,name=][,username=][,impltype=] " print diff --git a/src/ParallelContainer/SALOME_ParallelComponent_i.cxx b/src/ParallelContainer/SALOME_ParallelComponent_i.cxx index 597ef48cc..7e7602d75 100644 --- a/src/ParallelContainer/SALOME_ParallelComponent_i.cxx +++ b/src/ParallelContainer/SALOME_ParallelComponent_i.cxx @@ -53,7 +53,6 @@ int SIGUSR11 = 1000; extern bool _Sleeping ; static Engines_Parallel_Component_i * theEngines_Component ; -bool Engines_Parallel_Component_i::_isMultiStudy = false; bool Engines_Parallel_Component_i::_isMultiInstance = false; //============================================================================= diff --git a/src/ParallelContainer/SALOME_ParallelComponent_i.hxx b/src/ParallelContainer/SALOME_ParallelComponent_i.hxx index 98fe0e9ea..9ab9b5cb5 100644 --- a/src/ParallelContainer/SALOME_ParallelComponent_i.hxx +++ b/src/ParallelContainer/SALOME_ParallelComponent_i.hxx @@ -121,7 +121,6 @@ public: PortableServer::ObjectId * getId(); Engines_Parallel_Container_i *GetContainerPtr(); - static bool isMultiStudy(); static bool isMultiInstance(); static std::string GetDynLibraryName(const char *componentName); @@ -143,7 +142,6 @@ public: Engines::Parallel_Salome_file_proxy_impl * file); protected: - static bool _isMultiStudy; static bool _isMultiInstance; std::string _instanceName ; diff --git a/src/TOOLSDS/SALOMEDS_Tool.cxx b/src/TOOLSDS/SALOMEDS_Tool.cxx index 6b2e467de..9f9ffd6b7 100644 --- a/src/TOOLSDS/SALOMEDS_Tool.cxx +++ b/src/TOOLSDS/SALOMEDS_Tool.cxx @@ -132,15 +132,14 @@ std::string SALOMEDS_Tool::GetTmpDir() // purpose : Removes files listed in theFileList //============================================================================ void SALOMEDS_Tool::RemoveTemporaryFiles(const std::string& theDirectory, - const SALOMEDS::ListOfFileNames& theFiles, + const std::list& theFiles, const bool IsDirDeleted) { std::string aDirName = theDirectory; - int i, aLength = theFiles.length(); - for(i=1; i<=aLength; i++) { + for(std::list::const_iterator it = theFiles.begin(); it != theFiles.end(); it++) { std::string aFile(aDirName); - aFile += theFiles[i-1]; + aFile += *it; if(!Exists(aFile)) continue; #ifdef WIN32 @@ -170,11 +169,11 @@ namespace { SALOMEDS::TMPFile* PutFilesToStream(const std::string& theFromDirectory, - const SALOMEDS::ListOfFileNames& theFiles, - const SALOMEDS::ListOfFileNames& theFileNames, + const std::list& theFiles, + const std::list& theFileNames, const int theNamesOnly) { - int i, aLength = theFiles.length(); + int i = 0, aLength = theFiles.size(); if(aLength == 0) return (new SALOMEDS::TMPFile); @@ -190,12 +189,14 @@ namespace //Determine the required size of the buffer - for(i=0; i::const_iterator it_files = theFiles.begin(); + std::list::const_iterator it_names = theFileNames.begin(); + for(; it_files != theFiles.end(); it_files++, it_names++, i++) { //Check if the file exists if (!theNamesOnly) { // mpv 15.01.2003: if only file names must be stroed, then size of files is zero - std::string aFullPath = aTmpDir + const_cast(theFiles[i].in()); + std::string aFullPath = aTmpDir + *it_files; if(!Exists(aFullPath)) continue; #ifdef WIN32 std::ifstream aFile(aFullPath.c_str(), std::ios::binary); @@ -206,7 +207,7 @@ namespace aFileSize[i] = aFile.tellg(); aBufferSize += aFileSize[i]; //Add a space to store the file } - aFileNameSize[i] = strlen(theFileNames[i])+1; + aFileNameSize[i] = (*it_names).length()+1; aBufferSize += aFileNameSize[i]; //Add a space to store the file name aBufferSize += (theNamesOnly)?4:12; //Add 4 bytes: a length of the file name, // 8 bytes: length of the file itself @@ -227,10 +228,12 @@ namespace aCurrentPos = 4; - for(i=0; i(theFiles[i].in()); + std::string aFullPath = aTmpDir + *it_files; if(!Exists(aFullPath)) continue; #ifdef WIN32 aFile = new std::ifstream(aFullPath.c_str(), std::ios::binary); @@ -245,7 +248,7 @@ namespace aCurrentPos += 4; //Copy the file name to the buffer - memcpy((aBuffer + aCurrentPos), theFileNames[i], aFileNameSize[i]); + memcpy((aBuffer + aCurrentPos), (*it_names).c_str(), aFileNameSize[i]); aCurrentPos += aFileNameSize[i]; if (!theNamesOnly) { // mpv 15.01.2003: we don't copy file content to the buffer if !theNamesOnly @@ -277,17 +280,17 @@ namespace SALOMEDS::TMPFile* SALOMEDS_Tool::PutFilesToStream(const std::string& theFromDirectory, - const SALOMEDS::ListOfFileNames& theFiles, + const std::list& theFiles, const int theNamesOnly) { - SALOMEDS::ListOfFileNames aFileNames(theFiles); + std::list aFileNames(theFiles); return ::PutFilesToStream(theFromDirectory,theFiles,aFileNames,theNamesOnly); } SALOMEDS::TMPFile* -SALOMEDS_Tool::PutFilesToStream(const SALOMEDS::ListOfFileNames& theFiles, - const SALOMEDS::ListOfFileNames& theFileNames) +SALOMEDS_Tool::PutFilesToStream(const std::list& theFiles, + const std::list& theFileNames) { return ::PutFilesToStream("",theFiles,theFileNames,0); } @@ -296,12 +299,12 @@ SALOMEDS_Tool::PutFilesToStream(const SALOMEDS::ListOfFileNames& theFiles, // function : PutStreamToFile // purpose : converts the stream "theStream" to the files //============================================================================ -SALOMEDS::ListOfFileNames_var +std::list SALOMEDS_Tool::PutStreamToFiles(const SALOMEDS::TMPFile& theStream, const std::string& theToDirectory, const int theNamesOnly) { - SALOMEDS::ListOfFileNames_var aFiles = new SALOMEDS::ListOfFileNames; + std::list aFiles; if(theStream.length() == 0) return aFiles; @@ -320,8 +323,6 @@ SALOMEDS_Tool::PutStreamToFiles(const SALOMEDS::TMPFile& theStream, //Copy the number of files in the stream memcpy(&aNbFiles, aBuffer, sizeof(int)); - aFiles->length(aNbFiles); - for(i=0; i, the files for deletion are listed in // if is true is also deleted if it is empty static void RemoveTemporaryFiles(const std::string& theDirectory, - const SALOMEDS::ListOfFileNames& theFiles, + const std::list& theFiles, const bool IsDirDeleted); // Converts files listed in which are in into a byte sequence TMPFile static SALOMEDS::TMPFile* PutFilesToStream(const std::string& theFromDirectory, - const SALOMEDS::ListOfFileNames& theFiles, + const std::list& theFiles, const int theNamesOnly = 0); // Converts files listed in which will be named as pointed in the into a byte sequence TMPFile - static SALOMEDS::TMPFile* PutFilesToStream(const SALOMEDS::ListOfFileNames& theFiles, - const SALOMEDS::ListOfFileNames& theFileNames); + static SALOMEDS::TMPFile* PutFilesToStream(const std::list& theFiles, + const std::list& theFileNames); // Converts a byte sequence to files and places them in - static SALOMEDS::ListOfFileNames_var PutStreamToFiles(const SALOMEDS::TMPFile& theStream, - const std::string& theToDirectory, - const int theNamesOnly = 0); + static std::list PutStreamToFiles(const SALOMEDS::TMPFile& theStream, + const std::string& theToDirectory, + const int theNamesOnly = 0); // Returns the name by the path // for an example: if thePath = "/tmp/aaa/doc1.hdf" the function returns "doc1"