From: salome <> Date: Fri, 6 Jan 2006 19:36:54 +0000 (+0000) Subject: Correction compatibilité SALOME V3 X-Git-Tag: BEFORE_MERGE_AMA~4 X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Feficas.git;a=commitdiff_plain;h=d1420974811119977ce05bf809580fe6f9a816b5 Correction compatibilité SALOME V3 --- diff --git a/idl/EFICAS_Gen.idl b/idl/EFICAS_Gen.idl index 454c191b..e5122c9e 100644 --- a/idl/EFICAS_Gen.idl +++ b/idl/EFICAS_Gen.idl @@ -2,11 +2,12 @@ #define __EFICAS_GEN__ #include "SALOME_Component.idl" +#include "SALOMEDS.idl" #include "SALOME_Exception.idl" module EFICAS_ORB { - interface EFICAS_Gen : Engines::Component + interface EFICAS_Gen : Engines::Component, SALOMEDS::Driver { }; }; diff --git a/src/EFICAS/EFICAS.py b/src/EFICAS/EFICAS.py index 3d6fc04b..74520724 100644 --- a/src/EFICAS/EFICAS.py +++ b/src/EFICAS/EFICAS.py @@ -1,8 +1,61 @@ import EFICAS_ORB__POA + +import SALOMEDS__POA + import SALOME_ComponentPy + + + + +class SALOME_DriverPy_i(SALOMEDS__POA.Driver): + """ + Python implementation of generic SALOMEDS driver. + Should be inherited by any Python module's engine + to provide persistence mechanism. + """ + def __init__ (self, componentDataType): + print "SALOME_DriverPy.__init__: ",componentDataType + self._ComponentDataType = componentDataType + + def IORToLocalPersistentID(self, theSObject, IORString, isMultiFile, isASCII): + return theSObject.GetID() + + def LocalPersistentIDToIOR(self, theSObject, PersistentID, isMultiFile, isASCII): + return "" + + def ComponentDataType(self): + return self._ComponentDataType + + def Save(self, theComponent, theURL, isMultiFile): + return 'Rien' + + def SaveASCII(self, theComponent, theURL, isMultiFile): + return self.Save(theComponent, theURL, isMultiFile) + + def Load(self, theComponent, theStream, theURL, isMultiFile): + return 1 + + def LoadASCII(self, theComponent, theStream, theURL, isMultiFile): + return self.Load(theComponent, theStream, theURL, isMultiFile) + + def Close(self, theComponent): + pass + + def CanPublishInStudy(self, theIOR): + return 0 + + def PublishInStudy(self, theStudy, theSObject, theObject, theName): + return None + + def CanCopy(self, theObject): + return 0 + + + class EFICAS(EFICAS_ORB__POA.EFICAS_Gen, - SALOME_ComponentPy.SALOME_ComponentPy_i): + SALOME_ComponentPy.SALOME_ComponentPy_i, + SALOME_DriverPy_i ): """ Pour etre un composant SALOME cette classe Python doit avoir le nom du composant et heriter de la @@ -15,7 +68,10 @@ class EFICAS(EFICAS_ORB__POA.EFICAS_Gen, print "EFICAS.__init__: ",containerName,' ',instanceName SALOME_ComponentPy.SALOME_ComponentPy_i.__init__(self, orb, poa, contID, containerName,instanceName, interfaceName, 0 ) + SALOME_DriverPy_i.__init__( self, 'OTHER' ) # On stocke dans l'attribut _naming_service, une reference sur # le Naming Service CORBA self._naming_service=SALOME_ComponentPy.SALOME_NamingServicePy_i(self._orb) + + \ No newline at end of file