#include "SALOME_Exception.idl"
#include "SALOME_GenericObj.idl"
+#include "SALOME_Notebook.idl"
/*! \brief
This package contains the interfaces used for creation, management
/*! \brief Get the list of IDs of the Study's lockers.
*/
ListOfStrings GetLockerID();
+
+/*! \brief Access to notebook instance
+*/
+ SALOME::Notebook GetNotebook();
+
+/*! \brief Find an object by its component and entry (usually internal entry not available on high level)
+ even if object is not published yet in study
+*/
+ SALOME::GenericObj FindObjectByInternalEntry( in string theComponent, in string theEntry );
};
//==========================================================================
#define _SALOME_COMPONENT_IDL_
#include "SALOMEDS.idl"
+#include "SALOME_GenericObj.idl"
#include "SALOME_Exception.idl"
#include "SALOME_PyNode.idl"
\return an information about the given object.
*/
string getObjectInfo(in long studyId, in string entry);
+
+ //! Find object by its internal entry (OCAF or other) even it is not published in the study
+ /*!
+ \param theEntry object entry
+ */
+ SALOME::GenericObj FindObjectByInternalEntry( in string theEntry );
} ;
//! A block of binary data used for file transfer. The maximum size of the block is defined on server side.
\param block a data block to copy into the file identified by fileId
*/
void putBlock(in long fileId, in fileBlock block);
-
};
//! A file managed by a Salome_file.
#ifndef _NOTEBOOK_IDL_
#define _NOTEBOOK_IDL_
-#include "SALOME_Exception.idl"
#include "SALOME_GenericObj.idl"
/*! \brief
//! This interface describes parameterized object
interface ParameterizedObject : GenericObj
{
- //return object's entry
+ //! return object's entry
string GetEntry();
- //validity status
+ //! return object's component
+ string GetComponent();
+
+ //! validity status
boolean IsValid();
- //update management
- void SetToUpdate();
+ //! update management
void Update();
};
//! This enumeration describes data types supported by notebook functionality
- enum ParamType { TBoolean, TInteger, TReal, TExpression, TString };
+ enum ParamType { TUnknown, TBoolean, TInteger, TReal, TString };
+
+
//! This interface describes parameter object
interface Parameter : ParameterizedObject
{
- void SetValue( in string expr );
+ //! change expression of the parameter
+ void SetExpr( in string expr );
+
+ //! change value of the parameter
+ void SetReal( in double value );
+
+ //! return type of parameter
ParamType GetType();
- string AsString() raises(SALOME_Exception);
- long AsInteger() raises(SALOME_Exception);
- double AsDouble() raises(SALOME_Exception);
- boolean AsBoolean() raises(SALOME_Exception);
+ //! convert parameter into string
+ string AsString();
+
+ //! convert parameter into integer
+ long AsInteger();
+
+ //! convert parameter into real
+ double AsReal();
+
+ //! convert parameter into boolean
+ boolean AsBoolean();
};
+
+ //! This interface describes parameters container: Notebook
interface Notebook : GenericObj
{
//dependency management
- void AddDependency( in ParameterizedObject obj, in ParameterizedObject dep );
+
+ //! add new dependency between objects
+ boolean AddDependency( in ParameterizedObject obj, in ParameterizedObject dep );
+
+ //! remove dependency between objects
void RemoveDependency( in ParameterizedObject obj, in ParameterizedObject dep );
+
+ //! remove all dependencies of the object
void ClearDependencies( in ParameterizedObject obj );
- void Update( in ParameterizedObject obj );
+
+ //! set internal flags of update: it means that this object and all objects depending on it will be updated
+ void SetToUpdate( in ParameterizedObject obj );
+
+ //! update all objects marked as "need to update"
+ void Update();
+
+
+
+ //parameters management
+
+ //! add new parameter (expression) into notebook
+ boolean AddExpr( in string expr );
+
+ //! add new parameter (named expression) into notebook
+ boolean AddNameExpr( in string name, in string expr );
+
+ //! add new parameter (value) into notebook
+ boolean AddValue( in string name, in double value );
+
+ //! remove parameter from notebook
+ void Remove( in string name );
+
+ //! access to parameter from notebook
+ Parameter Param( in string name );
};
};
return cpu ;
}
+//=============================================================================
+/*!
+ * CORBA method:
+ */
+//=============================================================================
+SALOME::GenericObj_ptr Engines_Component_i::FindObjectByInternalEntry( const char* theEntry )
+{
+ return SALOME::GenericObj_ptr();
+}
//=============================================================================
/*!
// Object information
virtual bool hasObjectInfo() { return false; }
virtual char* getObjectInfo(CORBA::Long studyId, const char* entry) { return CORBA::string_dup(""); }
+
+ SALOME::GenericObj_ptr FindObjectByInternalEntry( const char* theEntry );
// --- local C++ methods
Launcher \
LifeCycleCORBA \
LifeCycleCORBA_SWIG \
+ Notebook \
SALOMEDSClient \
TOOLSDS \
SALOMEDSImpl \
ModuleGenerator \
Communication \
Communication_SWIG \
- DSC \
- Notebook
+ DSC
SUBDIR_CPPUNIT_BASE= \
Basics/Test \
-I$(srcdir)/../GenericObj \
-I$(srcdir)/../SALOMEDSClient \
-I$(srcdir)/../LifeCycleCORBA \
+ -I$(srcdir)/../Notebook \
-I$(top_builddir)/idl \
@CORBA_CXXFLAGS@ @CORBA_INCLUDES@
../SALOMEDSImpl/libSalomeDSImpl.la \
../GenericObj/libSalomeGenericObj.la \
../LifeCycleCORBA/libSalomeLifeCycleCORBA.la \
+ ../Notebook/libSalomeNotebook.la \
$(top_builddir)/idl/libSalomeIDLKernel.la\
@HDF5_LIBS@
#include "SALOMEDS_AttributeParameter_i.hxx"
#include "SALOMEDS_ChildIterator_i.hxx"
#include "SALOMEDS_Driver_i.hxx"
+#include "SALOMEDS_StudyBuilder.hxx"
#include "SALOMEDS.hxx"
#include "SALOMEDSImpl_SObject.hxx"
isLocal = (strcmp(theHostname, Kernel_Utils::GetHostname().c_str()) == 0 && pid == thePID)?1:0;
return reinterpret_cast<CORBA::LongLong>(_impl);
}
+
+SALOME::GenericObj_ptr SALOMEDS_Study_i::FindObjectByInternalEntry( const char* theComponent, const char* theEntry )
+{
+ SALOME::GenericObj_ptr aRes;
+ SALOMEDS::StudyBuilder_ptr aBuilder = NewBuilder();
+ SALOMEDS::SComponent_ptr aSComponent = FindComponent( theComponent );
+
+ if( !CORBA::is_nil( aSComponent ) )
+ {
+ SALOMEDS::GenericAttribute_ptr anAttr;
+ if( aBuilder->FindAttribute( aSComponent, anAttr, "AttributeIOR" ) )
+ {
+ SALOMEDS::AttributeIOR_ptr anAttrIOR = SALOMEDS::AttributeIOR::_narrow( anAttr );
+ CORBA::Object_var aCompObj = _orb->string_to_object( anAttrIOR->Value() );
+ Engines::Component_var aComponent = Engines::Component::_narrow( aCompObj );
+ aRes = aComponent->FindObjectByInternalEntry( theEntry );
+ }
+ }
+ return aRes;
+}
+
+SALOME::Notebook_ptr SALOMEDS_Study_i::GetNotebook()
+{
+ if( CORBA::is_nil( myNotebook ) )
+ {
+ SALOME_Notebook* aNb = new SALOME_Notebook( _this() );
+ myNotebook = aNb->_this();
+ }
+
+ return myNotebook._retn();
+}
// IDL headers
#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(SALOME_GenericObj)
+#include CORBA_SERVER_HEADER(SALOME_Notebook)
#include CORBA_SERVER_HEADER(SALOMEDS)
#include <stdio.h>
#include "SALOMEDSImpl_Study.hxx"
#include "SALOMEDSImpl_AttributeIOR.hxx"
+#include "SALOME_Notebook.hxx"
class Standard_EXPORT SALOMEDS_Study_i: public POA_SALOMEDS::Study
{
SALOMEDSImpl_Study* _impl;
SALOMEDS_StudyBuilder_i* _builder;
static std::map<SALOMEDSImpl_Study*, SALOMEDS_Study_i*> _mapOfStudies;
+ SALOME::Notebook_var myNotebook;
public:
virtual SALOMEDSImpl_Study* GetImpl() { return _impl; }
virtual CORBA::LongLong GetLocalImpl(const char* theHostname, CORBA::Long thePID, CORBA::Boolean& isLocal);
+
+ virtual SALOME::GenericObj_ptr FindObjectByInternalEntry( const char* theComponent, const char* theEntry );
+
+ virtual SALOME::Notebook_ptr GetNotebook();
};
#endif