From 2176c82ba8331d7880edfce8e01f9e2dbb1d4737 Mon Sep 17 00:00:00 2001 From: caremoli Date: Wed, 16 Jan 2008 07:47:47 +0000 Subject: [PATCH] CCAR: update from BR_Dev_For_4_0 branch --- src/Launcher/SALOME_Launcher.cxx | 12 ++++++++++- src/Launcher/SALOME_Launcher.hxx | 2 ++ .../SALOME_ResourcesManager.cxx | 4 ++-- src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx | 2 +- .../SALOMEDSImpl_StudyBuilder.cxx | 20 +++++-------------- 5 files changed, 21 insertions(+), 19 deletions(-) diff --git a/src/Launcher/SALOME_Launcher.cxx b/src/Launcher/SALOME_Launcher.cxx index 8ad02f628..3b73b7c02 100644 --- a/src/Launcher/SALOME_Launcher.cxx +++ b/src/Launcher/SALOME_Launcher.cxx @@ -93,11 +93,21 @@ void SALOME_Launcher::Shutdown() _ResManager->Shutdown(); PortableServer::ObjectId_var oid = _poa->servant_to_id(this); _poa->deactivate_object(oid); - _remove_ref(); + //_remove_ref(); if(!CORBA::is_nil(_orb)) _orb->shutdown(0); } +//============================================================================= +/*! CORBA Method: + * Returns the PID of the process + */ +//============================================================================= +CORBA::Long SALOME_Launcher::getPID() +{ + return (CORBA::Long)getpid(); +} + //============================================================================= /*! CORBA Method: * Submit a batch job on a cluster and returns the JobId diff --git a/src/Launcher/SALOME_Launcher.hxx b/src/Launcher/SALOME_Launcher.hxx index 5c83afbbf..08570fe72 100644 --- a/src/Launcher/SALOME_Launcher.hxx +++ b/src/Launcher/SALOME_Launcher.hxx @@ -64,6 +64,8 @@ public: void Shutdown(); + CORBA::Long getPID(); + static const char *_LauncherNameInNS; protected: diff --git a/src/ResourcesManager/SALOME_ResourcesManager.cxx b/src/ResourcesManager/SALOME_ResourcesManager.cxx index 20b689b1d..d693227a1 100644 --- a/src/ResourcesManager/SALOME_ResourcesManager.cxx +++ b/src/ResourcesManager/SALOME_ResourcesManager.cxx @@ -77,7 +77,7 @@ SALOME_ResourcesManager(CORBA::ORB_ptr orb, /*! * Standard constructor, parse resource file. * - if ${APPLI} exists in environment, - * look for ${HOME}/*{APPLI}/CatalogResources.xml + * look for ${HOME}/${APPLI}/CatalogResources.xml * - else look for default: * ${KERNEL_ROOT_DIR}/share/salome/resources/kernel/CatalogResources.xml * - parse XML resource file. @@ -142,7 +142,7 @@ void SALOME_ResourcesManager::Shutdown() _NS->Destroy_Name(_ResourcesManagerNameInNS); PortableServer::ObjectId_var oid = _poa->servant_to_id(this); _poa->deactivate_object(oid); - _remove_ref(); + //_remove_ref(); } //============================================================================= diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx index 3a3096d81..34ee8ed7b 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx @@ -57,7 +57,7 @@ SALOMEDSImpl_Study::SALOMEDSImpl_Study(const DF_Document* doc, _Saved = false ; _URL = ""; _StudyId = -1; - _autoFill = true; + _autoFill = false; _errorCode = ""; _useCaseBuilder = new SALOMEDSImpl_UseCaseBuilder(_doc); _builder = new SALOMEDSImpl_StudyBuilder(this); diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_StudyBuilder.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_StudyBuilder.cxx index eeeed8ac1..6dcb7bdd6 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_StudyBuilder.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_StudyBuilder.cxx @@ -53,6 +53,8 @@ static void Translate_persistentID_to_IOR(DF_Label& Lab, SALOMEDSImpl_Driver* dr SALOMEDSImpl_StudyBuilder::SALOMEDSImpl_StudyBuilder(const SALOMEDSImpl_Study* theOwner) { _errorCode = ""; + _callbackOnAdd=NULL; + _callbackOnRemove = NULL; _study = (SALOMEDSImpl_Study*)theOwner; _doc = _study->GetDocument(); } @@ -82,13 +84,7 @@ SALOMEDSImpl_SComponent SALOMEDSImpl_StudyBuilder::NewComponent(const string& Da //Always create component under main label. DF_Label L = _doc->Main(); - int imax = 0; - for (DF_ChildIterator it(L); it.More(); it.Next()) { - if (it.Value().Tag() > imax) - imax = it.Value().Tag(); - } - imax++; - DF_Label NL = L.FindChild(imax); + DF_Label NL = L.NewChild(); SALOMEDSImpl_AttributeComment::Set(NL, DataType); @@ -141,20 +137,14 @@ bool SALOMEDSImpl_StudyBuilder::RemoveComponent(const SALOMEDSImpl_SComponent& a //============================================================================ SALOMEDSImpl_SObject SALOMEDSImpl_StudyBuilder::NewObject(const SALOMEDSImpl_SObject& theFatherObject) { - _errorCode = ""; + _errorCode = ""; CheckLocked(); //Find label of father DF_Label Lab = theFatherObject.GetLabel(); //Create a new label - int imax = 0; - for (DF_ChildIterator it(Lab); it.More(); it.Next()) { - if (it.Value().Tag() > imax) - imax = it.Value().Tag(); - } - imax++; - DF_Label NewLab = Lab.FindChild(imax); + DF_Label NewLab = Lab.NewChild(); SALOMEDSImpl_SObject so = _study->GetSObject(NewLab); if(_callbackOnAdd) _callbackOnAdd->OnAddSObject(so); -- 2.39.2