raise RuntimeError, "Can't accesss module catalog"
return catalog.GetComponentList()
-## Get a study
-# \ingroup service
-def getStudy():
- """Get a study"""
- return salome.myStudy
-
-
import SALOMEDS
## Get a study to create SALOME study.
# \warning you should use instead the variable salome.myStudy.
# The codec to use for strings that are displayed in Salome study tree is Latin-1
ENCODING_FOR_SALOME_STUDY = "iso-8859-1"
-def getStudy():
- return salome.myStudy
-
## Return a \b StudyEditor instance to edit the study.
# \ingroup studyedit
def getStudyEditor():
}
bool TEST_getStudy() {
- SALOMEDS::Study_ptr myTestStudy = KERNEL::getStudy();
+ SALOMEDS::Study_ptr myTestStudy = KERNEL::getStudyServant();
if ( CORBA::is_nil(myTestStudy) ) {
return false;
}
* This returns a static reference to the SALOME study. The
* study can be used to get informations about it.
*/
- SALOMEDS::Study_ptr getStudy() {
+ SALOMEDS::Study_ptr getStudyServant() {
static SALOMEDS::Study_ptr aStudy;
if(CORBA::is_nil(aStudy)){
SALOME_NamingService *aNamingService = getNamingService();
KERNELHELPERS_EXPORT SALOME_NamingService * getNamingService();
KERNELHELPERS_EXPORT SALOME_LifeCycleCORBA * getLifeCycleCORBA();
KERNELHELPERS_EXPORT SALOME::Session_ptr getSalomeSession();
- KERNELHELPERS_EXPORT SALOMEDS::Study_ptr getStudy();
+ KERNELHELPERS_EXPORT SALOMEDS::Study_ptr getStudyServant();
KERNELHELPERS_EXPORT Engines::SalomeLauncher_ptr getSalomeLauncher();
KERNELHELPERS_EXPORT Engines::ResourcesManager_ptr getResourcesManager();
/** Canonic constructor. The object can't be used without a setStudy() */
SALOME_StudyEditor::SALOME_StudyEditor() {
- _sbuilder = KERNEL::getStudy()->NewBuilder();
+ _sbuilder = KERNEL::getStudyServant()->NewBuilder();
}
SALOMEDS::SObject_ptr SALOME_StudyEditor::newObject(SALOMEDS::SObject_ptr parent) {
}
SALOMEDS::SObject_ptr SALOME_StudyEditor::findObject(const char * entry) {
- SALOMEDS::SObject_var sobject = KERNEL::getStudy()->FindObjectID(entry);
+ SALOMEDS::SObject_var sobject = KERNEL::getStudyServant()->FindObjectID(entry);
return sobject._retn();
}
}
SALOMEDS::SComponent_ptr SALOME_StudyEditor::findRoot(const char * moduleName) {
- return KERNEL::getStudy()->FindComponent(moduleName);
+ return KERNEL::getStudyServant()->FindComponent(moduleName);
}
void SALOME_StudyEditor::setName(SALOMEDS::SObject_var sobject, const char * value) {
}
void KernelHelpersUnitTests::TEST_getStudy() {
- SALOMEDS::Study_ptr myTestStudy = KERNEL::getStudy();
+ SALOMEDS::Study_ptr myTestStudy = KERNEL::getStudyServant();
CPPUNIT_ASSERT(!CORBA::is_nil(myTestStudy));
// One can use the study to store some general properties
//============================================================================
static void DumpComponent(SALOMEDS::SObject_ptr SO, int offset) {
SALOMEDS::SObject_var RefSO;
- SALOMEDS::ChildIterator_var it = KERNEL::getStudy()->NewChildIterator(SO);
+ SALOMEDS::ChildIterator_var it = KERNEL::getStudyServant()->NewChildIterator(SO);
for (; it->More();it->Next()){
SALOMEDS::SObject_var CSO= it->Value();
SALOMEDS::GenericAttribute_var anAttr;
MESSAGE("Explore Study and Write name of each object if it exists");
char* name;
- SALOMEDS::SComponentIterator_var itcomp = KERNEL::getStudy()->NewComponentIterator();
+ SALOMEDS::SComponentIterator_var itcomp = KERNEL::getStudyServant()->NewComponentIterator();
int offset = 1;
for (; itcomp->More(); itcomp->Next()) {
SALOMEDS::SComponent_var SC = itcomp->Value();
try {
char* name;
- SALOMEDS::Study_var myStudy = KERNEL::getStudy();
+ SALOMEDS::Study_var myStudy = KERNEL::getStudyServant();
MESSAGE("Create Builder ");
SALOMEDS::StudyBuilder_var StudyBuild = myStudy->NewBuilder();
bool& isValidScript,
long& theStreamLength)
{
- SALOME_NamingService* namingService = KERNEL::getNamingService();
- CORBA::Object_var obj = namingService->Resolve("/Study");
- SALOMEDS::Study_var st = SALOMEDS::Study::_narrow(obj);
-
SALOMEDS::unlock();
Engines::TMPFile_var aStream;
std::string compName(entry, 0, pos), compID, tail(entry, pos+1, entry.length()-1);
if(_compNames.find(compName) == _compNames.end()) {
- _PTR(SObject) so = ClientFactory::Study(KERNEL::getStudy())->FindComponent(compName);
+ _PTR(SObject) so = ClientFactory::Study(KERNEL::getStudyServant())->FindComponent(compName);
if(!so) return entry;
compID = so->GetID();
_compNames[compName] = compID;
if(theID == "") anID = getDefaultVisualComponent();
else anID = theID;
- _PTR(AttributeParameter) ap = ClientFactory::Study(KERNEL::getStudy())->GetCommonParameters(anID, 0);
+ _PTR(AttributeParameter) ap = ClientFactory::Study(KERNEL::getStudyServant())->GetCommonParameters(anID, 0);
ap->SetBool(_AP_DUMP_PYTHON_, !isDumpPython(theID));
}
if(theID == "") anID = getDefaultVisualComponent();
else anID = theID;
- _PTR(AttributeParameter) ap = ClientFactory::Study(KERNEL::getStudy())->GetCommonParameters(anID, 0);
+ _PTR(AttributeParameter) ap = ClientFactory::Study(KERNEL::getStudyServant())->GetCommonParameters(anID, 0);
if(!ap) return false;
if(!ap->IsSet(_AP_DUMP_PYTHON_, PT_BOOLEAN)) return false;
return (bool)ap->GetBool(_AP_DUMP_PYTHON_);
dump += shift +"import iparameters\n";
- dump += shift + "ipar = iparameters.IParameters(theStudy.GetModuleParameters(\""+anID+"\", \""+moduleName+"\", 1))\n\n";
+ dump += shift + "ipar = iparameters.IParameters(salome.myStudy.GetModuleParameters(\""+anID+"\", \""+moduleName+"\", 1))\n\n";
std::vector<std::string> v = ip.getProperties();
if(v.size() > 0) {