development is very simple. The module contains a single
component and this component provides several services called \b
hello and \b goodbye.
-Each of these functions accepts a reference to the SALOME study and
+Each of these functions accepts
a character string as the arguments and returns the status of the operation.
The component also provides a simple GUI.
that are defined in the IDL interface \a HELLO_ORB::HELLO_Gen.
\code
-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 )
{
...
}
\code
void HELLOGUI::hello()
{
- SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>( application()->activeStudy() );
- _PTR(Study) studyDS = study->studyDS();
-
// request user name
bool ok;
QString name = QInputDialog::getText( getApp()->desktop(), tr( "QUE_HELLO_TITLE" ), tr( "QUE_ENTER_NAME" ),
if ( ok && !name.trimmed().isEmpty() ) {
// say hello to SALOME
- HELLO_ORB::status status = engine()->hello( _CAST(Study, studyDS)->GetStudy(), (const char*)name.toLatin1() );
+ HELLO_ORB::status status = engine()->hello( (const char*)name.toLatin1() );
// update Object browser
getApp()->updateObjectBrowser(true);
if ( !name.trimmed().isEmpty() ) {
// say goodby to SALOME
- HELLO_ORB::status status = engine()->goodbye( _CAST(Study, studyDS)->GetStudy(), (const char*)name.toLatin1() );
+ HELLO_ORB::status status = engine()->goodbye( (const char*)name.toLatin1() );
// update Object browser
getApp()->updateObjectBrowser(true);
>> salome.salome_init()
>> import HELLO_ORB
>> c = container.load_impl("HELLO", "HELLO")
->> c.hello(salome.myStudy, "Christian")
+>> c.hello("Christian")
</pre>
The last instruction invokes HELLO module's service \a hello(). Proceed as
import salome
salome.salome_init()
c = test(clt)
- c.hello(salome.myStudy, "Christian")
+ c.hello("Christian")
</pre>
The test function creates the LifeCycle object. It then asks for the