From: mpa Date: Fri, 3 Feb 2017 13:26:53 +0000 (+0300) Subject: Deleted deprecated code X-Git-Tag: V9_0_0~20^2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2Fmpa%2F23299;p=modules%2Fyacs.git Deleted deprecated code --- diff --git a/doc/cppsalome.rst b/doc/cppsalome.rst index f6c1bb9df..c65aa624c 100644 --- a/doc/cppsalome.rst +++ b/doc/cppsalome.rst @@ -122,8 +122,8 @@ This class contains a constructor whose arguments are imposed by SALOME, a virtu const char *instanceName, const char *interfaceName); virtual ~HELLO(); - HELLO_ORB::status hello ( SALOMEDS::Study_ptr study, const char* name ); - HELLO_ORB::status goodbye( SALOMEDS::Study_ptr study, const char* name ); + HELLO_ORB::status hello ( const char* name ); + HELLO_ORB::status goodbye( const char* name ); void copyOrMove( const HELLO_ORB::object_list& what, SALOMEDS::SObject_ptr where, CORBA::Long row, CORBA::Boolean isCopy ); @@ -147,12 +147,12 @@ to load the HELLO component:: The definitions of the constructor and the HELLOEngine_factory instantiation function (both normalized!), hello, goodbye and copyOrMove are given in the source file (HELLO.cxx):: - HELLO_ORB::status HELLO::hello( SALOMEDS::Study_ptr study, const char* name ) + HELLO_ORB::status HELLO::hello( const char* name ) { ... } - HELLO_ORB::status HELLO::goodbye( SALOMEDS::Study_ptr study, const char* name ) + HELLO_ORB::status HELLO::goodbye( const char* name ) { ... } @@ -237,7 +237,7 @@ Let us check that hello object is correctly typed, and we will call the hello se >>> print hello - >>> status=hello.hello(salome.myStudy, "Nicolas") + >>> status=hello.hello("Nicolas") >>> print status OP_OK diff --git a/doc/execution.rst b/doc/execution.rst index 1aede2c76..d455f8146 100644 --- a/doc/execution.rst +++ b/doc/execution.rst @@ -64,7 +64,7 @@ informed by the system about all problems detected by this operation. If a preliminary check is successfully done, schema run is created and then the user can start its execution in the chosen mode. Schema run -is exported to an XML file and passed to YACS CORBA engine and executed there. YACS CORBA engine is also given a study ID. +is exported to an XML file and passed to YACS CORBA engine and executed there. For visual representation of execution state the following means are provided by YACS module. diff --git a/doc/yacsgen.rst b/doc/yacsgen.rst index 41faa3146..b9ea4d296 100644 --- a/doc/yacsgen.rst +++ b/doc/yacsgen.rst @@ -1308,10 +1308,10 @@ Here is an excerpt from pygui1 example that shows how to add a method named crea compodefs=r""" class A: - def createObject( self, study, name ): + def createObject( self, name ): "Create object. " - builder = study.NewBuilder() - father = study.FindComponent( "pycompos" ) + builder = salome.myStudy.NewBuilder() + father = salome.myStudy.FindComponent( "pycompos" ) if father is None: father = builder.NewComponent( "pycompos" ) attr = builder.FindOrCreateAttribute( father, "AttributeName" ) @@ -1342,20 +1342,15 @@ fragment that will be included in the component class to effectively redefine th Here is an excerpt from cppgui1 example that shows how to redefine the DumpPython method in a C++ component:: compomethods=r""" - Engines::TMPFile* DumpPython(CORBA::Object_ptr theStudy, CORBA::Boolean isPublished, + Engines::TMPFile* DumpPython(CORBA::Boolean isPublished, CORBA::Boolean& isValidScript) { - SALOMEDS::Study_var aStudy = SALOMEDS::Study::_narrow(theStudy); - if(CORBA::is_nil(aStudy)) - return new Engines::TMPFile(0); - SALOMEDS::SObject_var aSO = aStudy->FindComponent("cppcompos"); + SALOMEDS::SObject_var aSO = KERNEL::getStudy()->FindComponent("cppcompos"); if(CORBA::is_nil(aSO)) return new Engines::TMPFile(0); std::string Script = "import cppcompos_ORB\n"; Script += "import salome\n"; Script += "compo = salome.lcc.FindOrLoadComponent('FactoryServer','cppcompos')\n"; - Script += "def RebuildData(theStudy):\n"; - Script += " compo.SetCurrentStudy(theStudy)\n"; const char* aScript=Script.c_str(); char* aBuffer = new char[strlen(aScript)+1]; strcpy(aBuffer, aScript); @@ -1400,10 +1395,10 @@ implementation from SALOME KERNEL) and an extra method (createObject) to a pytho SALOME_DriverPy.SALOME_DriverPy_i.__init__(self,"pycompos") return - def createObject( self, study, name ): + def createObject( self, name ): "Create object. " - builder = study.NewBuilder() - father = study.FindComponent( "pycompos" ) + builder = salome.myStudy.NewBuilder() + father = salome.myStudy.FindComponent( "pycompos" ) if father is None: father = builder.NewComponent( "pycompos" ) attr = builder.FindOrCreateAttribute( father, "AttributeName" ) @@ -1434,7 +1429,7 @@ one file (myinterface.idl) that contains the definition of interface Idl_A:: interface Idl_A : SALOMEDS::Driver { - void createObject(in SALOMEDS::Study theStudy, in string name) raises (SALOME::SALOME_Exception); + void createObject(in string name) raises (SALOME::SALOME_Exception); }; In this simple case, it is also possible to include directly the content of the file with the *interfacedefs* parameter. diff --git a/src/runtime/CMakeLists.txt b/src/runtime/CMakeLists.txt index 71fb61e96..3e24bbc7b 100644 --- a/src/runtime/CMakeLists.txt +++ b/src/runtime/CMakeLists.txt @@ -29,6 +29,7 @@ IF(SALOME_YACS_USE_KERNEL) SalomeIDLKernel SalomeNS SalomeContainer + SalomeKernelHelpers SALOMEBasics SalomeResourcesManager OpUtil diff --git a/src/runtime/StudyNodes.cxx b/src/runtime/StudyNodes.cxx index 77bc09a05..6b0a32f25 100644 --- a/src/runtime/StudyNodes.cxx +++ b/src/runtime/StudyNodes.cxx @@ -25,6 +25,7 @@ #include "SalomeProc.hxx" #include "SALOME_NamingService.hxx" +#include "SALOME_KernelServices.hxx" #include "SALOMEDS.hh" #include "SALOMEDS_Attributes.hh" @@ -74,20 +75,6 @@ void StudyInNode::setData(OutputPort* port, const std::string& data) void StudyInNode::execute() { DEBTRACE("+++++++ StudyInNode::execute +++++++++++"); - SALOME_NamingService NS(getSALOMERuntime()->getOrb()); - CORBA::Object_var obj=NS.Resolve("/Study"); - if(CORBA::is_nil(obj)) - { - _errorDetails="Execution problem: no naming service"; - throw Exception(_errorDetails); - } - - SALOMEDS::Study_var myStudy = SALOMEDS::Study::_narrow(obj); - if(CORBA::is_nil(myStudy)) - { - _errorDetails="Execution problem: no study"; - throw Exception(_errorDetails); - } std::list::const_iterator iter; for(iter = _setOfOutputPort.begin(); iter != _setOfOutputPort.end(); iter++) @@ -95,7 +82,7 @@ void StudyInNode::execute() OutputStudyPort *outp = dynamic_cast(*iter); try { - outp->getDataFromStudy(myStudy); + outp->getDataFromStudy(); } catch(Exception& e) { @@ -178,10 +165,10 @@ void StudyOutNode::setData(InputPort* port, const std::string& data) } /* -SALOMEDS::SObject_ptr findOrCreateSoWithName(SALOMEDS::Study_ptr study, SALOMEDS::StudyBuilder_ptr builder, +SALOMEDS::SObject_ptr findOrCreateSoWithName(SALOMEDS::StudyBuilder_ptr builder, SALOMEDS::SObject_ptr sobj, const std::string& name) { - SALOMEDS::ChildIterator_var anIterator= study->NewChildIterator(sobj); + SALOMEDS::ChildIterator_var anIterator= KERNEL::getStudyServant()->NewChildIterator(sobj); SALOMEDS::GenericAttribute_var anAttr; SALOMEDS::AttributeName_var namAttr ; SALOMEDS::SObject_var result=SALOMEDS::SObject::_nil(); @@ -215,22 +202,8 @@ SALOMEDS::SObject_ptr findOrCreateSoWithName(SALOMEDS::Study_ptr study, SALOMEDS void StudyOutNode::execute() { DEBTRACE("+++++++ StudyOutNode::execute +++++++++++"); - SALOME_NamingService NS(getSALOMERuntime()->getOrb()); - CORBA::Object_var obj=NS.Resolve("/Study"); - if(CORBA::is_nil(obj)) - { - _errorDetails="Execution problem: no naming service"; - throw Exception(_errorDetails); - } - - SALOMEDS::Study_var myStudy = SALOMEDS::Study::_narrow(obj); - if(CORBA::is_nil(myStudy)) - { - _errorDetails="Execution problem: no study"; - throw Exception(_errorDetails); - } - SALOMEDS::StudyBuilder_var aBuilder =myStudy->NewBuilder() ; + SALOMEDS::StudyBuilder_var aBuilder =KERNEL::getStudyServant()->NewBuilder() ; if(CORBA::is_nil(aBuilder)) { _errorDetails="Execution problem: can not create StudyBuilder"; @@ -246,13 +219,13 @@ void StudyOutNode::execute() for(iter = _setOfInputPort.begin(); iter != _setOfInputPort.end(); iter++) { InputStudyPort *inp = dynamic_cast(*iter); - inp->putDataInStudy(myStudy,aBuilder); + inp->putDataInStudy(aBuilder); } // save in file if ref is given if(_ref != "") { - myStudy->SaveAs(_ref.c_str(), false, false); + KERNEL::getStudyServant()->SaveAs(_ref.c_str(), false, false); } DEBTRACE("+++++++ end StudyOutNode::execute +++++++++++" ); } diff --git a/src/runtime/StudyPorts.cxx b/src/runtime/StudyPorts.cxx index 6bf53daca..98d832b2a 100644 --- a/src/runtime/StudyPorts.cxx +++ b/src/runtime/StudyPorts.cxx @@ -26,6 +26,7 @@ #include "RuntimeSALOME.hxx" #include "SALOMEDS_Attributes.hh" +#include "SALOME_KernelServices.hxx" #include #include @@ -135,16 +136,16 @@ std::string OutputStudyPort::getAsString() return getData(); } -void OutputStudyPort::getDataFromStudy(SALOMEDS::Study_var myStudy) +void OutputStudyPort::getDataFromStudy() { std::string data = getData(); DEBTRACE("data: " << data ); //try an id - SALOMEDS::SObject_var aSO = myStudy->FindObjectID(data.c_str()); + SALOMEDS::SObject_var aSO = KERNEL::getStudyServant()->FindObjectID(data.c_str()); if(CORBA::is_nil(aSO)) { //try a path - aSO=myStudy->FindObjectByPath(data.c_str()); + aSO=KERNEL::getStudyServant()->FindObjectByPath(data.c_str()); if(CORBA::is_nil(aSO)) { std::stringstream msg; @@ -153,7 +154,7 @@ void OutputStudyPort::getDataFromStudy(SALOMEDS::Study_var myStudy) } } - CORBA::String_var path=myStudy->GetObjectPath(aSO); + CORBA::String_var path=KERNEL::getStudyServant()->GetObjectPath(aSO); DEBTRACE(path); CORBA::String_var id=aSO->GetID(); DEBTRACE(id); @@ -230,10 +231,10 @@ void OutputStudyPort::getDataFromStudy(SALOMEDS::Study_var myStudy) -SALOMEDS::SObject_ptr findOrCreateSoWithName(SALOMEDS::Study_ptr study, SALOMEDS::StudyBuilder_ptr builder, +SALOMEDS::SObject_ptr findOrCreateSoWithName(SALOMEDS::StudyBuilder_ptr builder, SALOMEDS::SObject_ptr sobj, const std::string& name) { - SALOMEDS::ChildIterator_var anIterator= study->NewChildIterator(sobj); + SALOMEDS::ChildIterator_var anIterator= KERNEL::getStudyServant()->NewChildIterator(sobj); SALOMEDS::GenericAttribute_var anAttr; SALOMEDS::AttributeName_var namAttr ; SALOMEDS::SObject_var result=SALOMEDS::SObject::_nil(); @@ -342,7 +343,7 @@ std::string InputStudyPort::getAsString() return getData(); } -void InputStudyPort::putDataInStudy(SALOMEDS::Study_var myStudy,SALOMEDS::StudyBuilder_var aBuilder) +void InputStudyPort::putDataInStudy(SALOMEDS::StudyBuilder_var aBuilder) { SALOMEDS::GenericAttribute_var aGAttr; SALOMEDS::SObject_var aSO ; @@ -353,11 +354,11 @@ void InputStudyPort::putDataInStudy(SALOMEDS::Study_var myStudy,SALOMEDS::StudyB std::string data = getData(); DEBTRACE("data: " << data ); //try to find an existing id (i:j:k...) - aSO = myStudy->FindObjectID(data.c_str()); + aSO = KERNEL::getStudyServant()->FindObjectID(data.c_str()); if(CORBA::is_nil(aSO)) { // the id does not exist. Try to create it by id - aSO=myStudy->CreateObjectID(data.c_str()); + aSO=KERNEL::getStudyServant()->CreateObjectID(data.c_str()); if(!CORBA::is_nil(aSO)) { aGAttr=aBuilder->FindOrCreateAttribute(aSO,"AttributeName"); @@ -432,7 +433,7 @@ void InputStudyPort::putDataInStudy(SALOMEDS::Study_var myStudy,SALOMEDS::StudyB } // Does component entry exist ? - aSO=myStudy->FindObjectByPath(pname.c_str()); + aSO=KERNEL::getStudyServant()->FindObjectByPath(pname.c_str()); if(CORBA::is_nil(aSO)) { // We have not been able to publish the object with Salome Driver, make it the light way @@ -445,7 +446,7 @@ void InputStudyPort::putDataInStudy(SALOMEDS::Study_var myStudy,SALOMEDS::StudyB aGAttr=aBuilder->FindOrCreateAttribute(aFather,"AttributeName"); anAttr = SALOMEDS::AttributeName::_narrow( aGAttr ); anAttr->SetValue(name.c_str()); - aSO=myStudy->FindObjectByPath(pname.c_str()); + aSO=KERNEL::getStudyServant()->FindObjectByPath(pname.c_str()); } begin=data.find_first_not_of("/",pos); @@ -456,7 +457,7 @@ void InputStudyPort::putDataInStudy(SALOMEDS::Study_var myStudy,SALOMEDS::StudyB name=data.substr(begin,pos-begin); else name=data.substr(begin); - aSO=findOrCreateSoWithName(myStudy,aBuilder,aSO,name); + aSO=findOrCreateSoWithName(aBuilder,aSO,name); begin=data.find_first_not_of("/",pos); } } diff --git a/src/runtime/StudyPorts.hxx b/src/runtime/StudyPorts.hxx index 831fd45ee..671e42115 100644 --- a/src/runtime/StudyPorts.hxx +++ b/src/runtime/StudyPorts.hxx @@ -42,7 +42,7 @@ namespace YACS virtual std::string getPyObj(); virtual std::string getAsString(); virtual std::string typeName() {return "YACS__ENGINE__OutputStudyPort";} - virtual void getDataFromStudy(SALOMEDS::Study_var myStudy); + virtual void getDataFromStudy(); protected: std::string _storeData; }; @@ -61,7 +61,7 @@ namespace YACS virtual std::string getPyObj(); virtual std::string getAsString(); virtual std::string typeName() {return "YACS__ENGINE__InputStudyPort";} - virtual void putDataInStudy(SALOMEDS::Study_var myStudy,SALOMEDS::StudyBuilder_var aBuilder); + virtual void putDataInStudy(SALOMEDS::StudyBuilder_var aBuilder); protected: std::string _storeData; }; diff --git a/src/salomegui/resources/YACSCatalog.xml.in b/src/salomegui/resources/YACSCatalog.xml.in index b04b536af..6281f8f00 100644 --- a/src/salomegui/resources/YACSCatalog.xml.in +++ b/src/salomegui/resources/YACSCatalog.xml.in @@ -38,7 +38,6 @@ P. RASCLE @SALOMEYACS_VERSION@ EDF - RD - 1 ModuleYacs.png 'linux' ~ OS diff --git a/src/salomeloader/samples/GeomGraph.xml b/src/salomeloader/samples/GeomGraph.xml index 93efd237a..d4ab7aa0e 100644 --- a/src/salomeloader/samples/GeomGraph.xml +++ b/src/salomeloader/samples/GeomGraph.xml @@ -31,9 +31,6 @@ GeomGraph - -long - SetStudyID__theStudyID double MakeBox__theX1 diff --git a/src/salomeloader/samples/testvisu20.xml b/src/salomeloader/samples/testvisu20.xml index f8f658566..e087e44d5 100644 --- a/src/salomeloader/samples/testvisu20.xml +++ b/src/salomeloader/samples/testvisu20.xml @@ -112,12 +112,8 @@ - - - - aVisu ", aVisu ]]> diff --git a/src/salomewrap/SuitWrapper.cxx b/src/salomewrap/SuitWrapper.cxx index 453326a12..3d5abbcf7 100644 --- a/src/salomewrap/SuitWrapper.cxx +++ b/src/salomewrap/SuitWrapper.cxx @@ -60,9 +60,6 @@ QWidget* SuitWrapper::getNewWindow(QGraphicsScene *scene) return module->getNewWindow(scene); } -/*! - * return studyId used in context delete when study is closed. - */ void SuitWrapper::AssociateViewToWindow(QGraphicsView* gView, QWidget* viewWindow) { SalomeWrap_Module* module = dynamic_cast(_wrapped); diff --git a/src/wrappergen/src/parse5.awk b/src/wrappergen/src/parse5.awk index 716d97dfe..8acdb68bd 100644 --- a/src/wrappergen/src/parse5.awk +++ b/src/wrappergen/src/parse5.awk @@ -36,7 +36,6 @@ BEGIN { " ""\n"\ " 1.0\n"\ " \n"\ - " 1\n"\ " "class_name".png\n"\ " 1\n"\ " " >> catalog_file diff --git a/src/wrappergen/src/runIDLparser b/src/wrappergen/src/runIDLparser index 8055187cd..3d6f705f8 100755 --- a/src/wrappergen/src/runIDLparser +++ b/src/wrappergen/src/runIDLparser @@ -40,7 +40,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/src/yacsloader/samples/schema2.xml b/src/yacsloader/samples/schema2.xml index 0f41a11d8..2fb838d78 100644 --- a/src/yacsloader/samples/schema2.xml +++ b/src/yacsloader/samples/schema2.xml @@ -146,9 +146,7 @@ orb = CORBA.ORB_init([], CORBA.ORB_ID) lcc = LifeCycleCORBA(orb) naming_service = SALOME_NamingServicePy_i(orb) - aStudy = naming_service.Resolve('Study') aVisu = lcc.FindOrLoadComponent("FactoryServer","VISU") - aVisu.SetCurrentStudy(aStudy) aViewManager=aVisu.GetViewManager() aView=aViewManager.Create3DView() medFile = os.getenv('DATA_DIR') + '/MedFiles/' + "TimeStamps.med" diff --git a/src/yacsloader/samples/sinline1.xml b/src/yacsloader/samples/sinline1.xml index 8050df128..c783348a3 100644 --- a/src/yacsloader/samples/sinline1.xml +++ b/src/yacsloader/samples/sinline1.xml @@ -53,7 +53,7 @@ param['hostname']=machine param['container_name']=container compo=salome.lcc.LoadComponent(param, "HELLO") - print compo.hello(salome.myStudy, p1) + print compo.hello(p1) print p1 @@ -89,7 +89,7 @@ param['hostname']=machine param['container_name']=container compo=salome.lcc.LoadComponent(param, "HELLO") - print compo.hello(salome.myStudy, p1) + print compo.hello(p1) print p1 diff --git a/src/yacsloader/samples/sinline4.xml b/src/yacsloader/samples/sinline4.xml index 63e12e9fc..aa30bb781 100644 --- a/src/yacsloader/samples/sinline4.xml +++ b/src/yacsloader/samples/sinline4.xml @@ -55,7 +55,7 @@ param['hostname']=machine param['container_name']=container compo=salome.lcc.LoadComponent(param, "HELLO") - print compo.hello(salome.myStudy, p1) + print compo.hello(p1) print p1 @@ -91,7 +91,7 @@ param['hostname']=machine param['container_name']=container compo=salome.lcc.LoadComponent(param, "HELLO") - print compo.hello(salome.myStudy, p1) + print compo.hello(p1) print p1