From a24bb576bb63bc9745095d6a99474930548a0eb2 Mon Sep 17 00:00:00 2001 From: nri Date: Tue, 20 May 2003 12:31:20 +0000 Subject: [PATCH] NRI : Replace Med by MED. --- src/MED/MED_test1.py | 2 +- src/MED/MED_test2.py | 2 +- src/MED/Med_Gen_i.cxx | 43 +++++++++++++++----- src/MEDGUI/MedGUI.cxx | 2 +- src/MedCorba_Swig/batchmode_medcorba_test.py | 2 +- src/MedCorba_Swig/medcorba_test.py | 2 +- src/MedMem/FieldOf_i.hxx | 2 +- src/MedMem/Med_i.cxx | 2 +- src/MedMem/Mesh_i.cxx | 4 +- src/MedMem/Support_i.cxx | 2 +- 10 files changed, 43 insertions(+), 20 deletions(-) diff --git a/src/MED/MED_test1.py b/src/MED/MED_test1.py index 8ce0e3f66..815fae438 100755 --- a/src/MED/MED_test1.py +++ b/src/MED/MED_test1.py @@ -9,7 +9,7 @@ import salome -med=salome.lcc.FindOrLoadComponent("FactoryServer", "Med") +med=salome.lcc.FindOrLoadComponent("FactoryServer", "MED") import os filePath=os.getenv("SALOME_BUILD") diff --git a/src/MED/MED_test2.py b/src/MED/MED_test2.py index 1169d5c78..47ce56eb8 100755 --- a/src/MED/MED_test2.py +++ b/src/MED/MED_test2.py @@ -14,7 +14,7 @@ import os filePath=os.getenv("SALOME_BUILD") filePath=filePath+"/../SALOME_ROOT/data/" -med=salome.lcc.FindOrLoadComponent("FactoryServer", "Med") +med=salome.lcc.FindOrLoadComponent("FactoryServer", "MED") try: mesh=med.readMeshInFile(filePath+"/mesh.med", salome.myStudyName,"Mesh 1") diff --git a/src/MED/Med_Gen_i.cxx b/src/MED/Med_Gen_i.cxx index b9cb07b2e..ae87fc1f2 100755 --- a/src/MED/Med_Gen_i.cxx +++ b/src/MED/Med_Gen_i.cxx @@ -127,7 +127,7 @@ void Med_Gen_i::addInStudy(SALOMEDS::Study_var myStudy) myBuilder->NewCommand(); // Create SComponent labelled 'Med' if it doesn't already exit - SALOMEDS::SComponent_var medfather = myStudy->FindComponent("Med"); + SALOMEDS::SComponent_var medfather = myStudy->FindComponent("MED"); if ( CORBA::is_nil(medfather) ) { // mpv: component label must be created in spite of "Locked" study flag state @@ -135,10 +135,18 @@ void Med_Gen_i::addInStudy(SALOMEDS::Study_var myStudy) if (aLocked) myStudy->GetProperties()->SetLocked(false); MESSAGE("Add Component Med"); - medfather = myBuilder->NewComponent("Med"); + medfather = myBuilder->NewComponent("MED"); SALOMEDS::GenericAttribute_var anAttr = myBuilder->FindOrCreateAttribute(medfather, "AttributeName"); SALOMEDS::AttributeName_var aName = SALOMEDS::AttributeName::_narrow(anAttr); - aName->SetValue("Med"); + //NRI aName->SetValue("Med"); + + CORBA::Object_var objVarN = _NS->Resolve("/Kernel/ModulCatalog"); + SALOME_ModuleCatalog::ModuleCatalog_var Catalogue = SALOME_ModuleCatalog::ModuleCatalog::_narrow(objVarN); + SALOME_ModuleCatalog::Acomponent_var Comp = Catalogue->GetComponent( "MED" ); + if ( !Comp->_is_nil() ) { + aName->SetValue( Comp->componentusername() ); + } + // Utilisation de this deconseillee par Paul ?? // myBuilder->DefineComponentInstance(medfather,POA_Engines::Med_Gen::_this()); CORBA::Object_var myO = _poa->id_to_reference(*_id); // this ior... @@ -310,7 +318,7 @@ throw (SALOME::SALOME_Exception) SALOME::BAD_PARAM); SALOMEDS::StudyBuilder_var myBuilder = myStudy->NewBuilder(); - SALOMEDS::SComponent_var medfather = myStudy->FindComponent("Med"); + SALOMEDS::SComponent_var medfather = myStudy->FindComponent("MED"); if (CORBA::is_nil(medfather)) { myBuilder->NewCommand(); @@ -318,10 +326,18 @@ throw (SALOME::SALOME_Exception) bool aLocked = myStudy->GetProperties()->IsLocked(); if (aLocked) myStudy->GetProperties()->SetLocked(false); - medfather = myBuilder->NewComponent("Med"); + medfather = myBuilder->NewComponent("MED"); SALOMEDS::AttributeName_var aName = SALOMEDS::AttributeName::_narrow( myBuilder->FindOrCreateAttribute(medfather, "AttributeName")); - aName->SetValue("Med"); + //NRI aName->SetValue("Med"); + + CORBA::Object_var objVarN = _NS->Resolve("/Kernel/ModulCatalog"); + SALOME_ModuleCatalog::ModuleCatalog_var Catalogue = SALOME_ModuleCatalog::ModuleCatalog::_narrow(objVarN); + SALOME_ModuleCatalog::Acomponent_var Comp = Catalogue->GetComponent( "MED" ); + if ( !Comp->_is_nil() ) { + aName->SetValue( Comp->componentusername() ); + } + CORBA::Object_var myO = _poa->id_to_reference(*_id); // this ior... myBuilder->DefineComponentInstance(medfather,myO); @@ -595,7 +611,7 @@ void Med_Gen_i::Close(SALOMEDS::SComponent_ptr theComponent) char* Med_Gen_i::ComponentDataType() { MESSAGE("Med_Gen_i::ComponentDataType"); - return strdup("Med") ; /* What is this type ? */ + return strdup("MED") ; /* What is this type ? */ } //============================================================================= @@ -777,14 +793,21 @@ SALOMEDS::SObject_ptr Med_Gen_i::PublishInStudy(SALOMEDS::Study_ptr theStudy, SALOMEDS::GenericAttribute_var anAttr; SALOMEDS::AttributeName_var aName; SALOMEDS::AttributeIOR_var anIOR; - SALOMEDS::SComponent_var aFather = theStudy->FindComponent("Med"); + SALOMEDS::SComponent_var aFather = theStudy->FindComponent("MED"); if (aFather->_is_nil()) { - aFather = aBuilder->NewComponent("Med"); + aFather = aBuilder->NewComponent("MED"); if (aFather->_is_nil()) return aResultSO; anAttr = aBuilder->FindOrCreateAttribute(aFather, "AttributeName"); aName = SALOMEDS::AttributeName::_narrow(anAttr); - aName->SetValue("MED"); + //NRI aName->SetValue("MED"); + + CORBA::Object_var objVarN = _NS->Resolve("/Kernel/ModulCatalog"); + SALOME_ModuleCatalog::ModuleCatalog_var Catalogue = SALOME_ModuleCatalog::ModuleCatalog::_narrow(objVarN); + SALOME_ModuleCatalog::Acomponent_var Comp = Catalogue->GetComponent( "MED" ); + if ( !Comp->_is_nil() ) { + aName->SetValue( Comp->componentusername() ); + } aBuilder->DefineComponentInstance(aFather, Med_Gen::_this()); } diff --git a/src/MEDGUI/MedGUI.cxx b/src/MEDGUI/MedGUI.cxx index d7d863ac3..f3e2a855e 100644 --- a/src/MEDGUI/MedGUI.cxx +++ b/src/MEDGUI/MedGUI.cxx @@ -532,7 +532,7 @@ bool MedGUI::DumpSubMesh( SALOME_MED::FAMILY_var Fam ) Engines::Med_Gen_ptr MedGUI::InitMedGen(QAD_Desktop* parent) { Engines::Component_var comp = - parent->getEngine("FactoryServer", "Med"); + parent->getEngine("FactoryServer", "MED"); MESSAGE("_________________________________________"); Engines::Med_Gen_var clr = Engines::Med_Gen::_narrow(comp); ASSERT(!CORBA::is_nil(clr)); diff --git a/src/MedCorba_Swig/batchmode_medcorba_test.py b/src/MedCorba_Swig/batchmode_medcorba_test.py index 8d08b2a34..ad1373cf2 100755 --- a/src/MedCorba_Swig/batchmode_medcorba_test.py +++ b/src/MedCorba_Swig/batchmode_medcorba_test.py @@ -97,7 +97,7 @@ medFile = "cube_hexa8_quad4.med" print "Loading of the Med Component" print "" -med_comp = batchmode_salome.lcc.FindOrLoadComponent("FactoryServer", "Med") +med_comp = batchmode_salome.lcc.FindOrLoadComponent("FactoryServer", "MED") med_comp.readStructFile(medFile,studyCurrent) diff --git a/src/MedCorba_Swig/medcorba_test.py b/src/MedCorba_Swig/medcorba_test.py index bbbe8c0a9..4961487cb 100644 --- a/src/MedCorba_Swig/medcorba_test.py +++ b/src/MedCorba_Swig/medcorba_test.py @@ -84,7 +84,7 @@ medFile = "cube_hexa8_quad4.med" print "Loading of the Med Component" print "" -med_comp = salome.lcc.FindOrLoadComponent("FactoryServer", "Med") +med_comp = salome.lcc.FindOrLoadComponent("FactoryServer", "MED") med_comp.readStructFile(medFile,studyCurrent) diff --git a/src/MedMem/FieldOf_i.hxx b/src/MedMem/FieldOf_i.hxx index 3e353d331..75678d229 100644 --- a/src/MedMem/FieldOf_i.hxx +++ b/src/MedMem/FieldOf_i.hxx @@ -473,7 +473,7 @@ throw (SALOME::SALOME_Exception, SALOMEDS::StudyBuilder::LockProtection) SALOMEDS::AttributeIOR_var aIOR; // Create SComponent labelled 'Med' - SALOMEDS::SComponent_var medfather = myStudy->FindComponent("Med"); + SALOMEDS::SComponent_var medfather = myStudy->FindComponent("MED"); if ( CORBA::is_nil(medfather) ) THROW_SALOME_CORBA_EXCEPTION("SComponent labelled 'Med' not Found",SALOME::INTERNAL_ERROR); diff --git a/src/MedMem/Med_i.cxx b/src/MedMem/Med_i.cxx index c1cfc9c8d..3c0830489 100644 --- a/src/MedMem/Med_i.cxx +++ b/src/MedMem/Med_i.cxx @@ -805,7 +805,7 @@ throw (SALOME::SALOME_Exception, SALOMEDS::StudyBuilder::LockProtection) SALOMEDS::AttributeIOR_var aIOR; // Create SComponent labelled 'MED' if it doesn't already exit - SALOMEDS::SComponent_var medfather = myStudy->FindComponent("Med"); + SALOMEDS::SComponent_var medfather = myStudy->FindComponent("MED"); if ( CORBA::is_nil(medfather) ) { THROW_SALOME_CORBA_EXCEPTION("Component Med not found", diff --git a/src/MedMem/Mesh_i.cxx b/src/MedMem/Mesh_i.cxx index ca28b495c..881dd2bd4 100644 --- a/src/MedMem/Mesh_i.cxx +++ b/src/MedMem/Mesh_i.cxx @@ -976,7 +976,7 @@ throw (SALOME::SALOME_Exception, SALOMEDS::StudyBuilder::LockProtection) SALOMEDS::AttributeIOR_var aIOR; // Find SComponent labelled 'MED' - SALOMEDS::SComponent_var medfather = myStudy->FindComponent("Med"); + SALOMEDS::SComponent_var medfather = myStudy->FindComponent("MED"); if ( CORBA::is_nil(medfather) ) THROW_SALOME_CORBA_EXCEPTION("SComponent labelled 'Med' not Found",SALOME::INTERNAL_ERROR); @@ -1035,7 +1035,7 @@ throw (SALOME::SALOME_Exception, SALOMEDS::StudyBuilder::LockProtection) SALOMEDS::AttributeComment_var aComment; // Find SComponent labelled 'Med' - SALOMEDS::SComponent_var medfather = myStudy->FindComponent("Med"); + SALOMEDS::SComponent_var medfather = myStudy->FindComponent("MED"); if ( CORBA::is_nil(medfather) ) THROW_SALOME_CORBA_EXCEPTION("SComponent labelled 'Med' not Found",SALOME::INTERNAL_ERROR); diff --git a/src/MedMem/Support_i.cxx b/src/MedMem/Support_i.cxx index f59bb1cf9..0804a3f9a 100644 --- a/src/MedMem/Support_i.cxx +++ b/src/MedMem/Support_i.cxx @@ -407,7 +407,7 @@ void SUPPORT_i::addInStudy (SALOMEDS::Study_ptr myStudy, SALOME_MED::SUPPORT_ptr // Find SComponent labelled 'Med' MESSAGE("Find SComponent labelled 'Med'"); - SALOMEDS::SComponent_var medfather = myStudy->FindComponent("Med"); + SALOMEDS::SComponent_var medfather = myStudy->FindComponent("MED"); if ( CORBA::is_nil(medfather) ) THROW_SALOME_CORBA_EXCEPTION("SComponent labelled 'Med' not Found",SALOME::INTERNAL_ERROR); -- 2.39.2