]> SALOME platform Git repositories - modules/eficas.git/commitdiff
Salome HOME
Correction compatibilité SALOME V3 depart_Qxembed v1_2_0
authorsalome <>
Fri, 6 Jan 2006 19:36:54 +0000 (19:36 +0000)
committersalome <>
Fri, 6 Jan 2006 19:36:54 +0000 (19:36 +0000)
idl/EFICAS_Gen.idl
src/EFICAS/EFICAS.py

index 454c191b289d80e76428a2326b43c870590197ce..e5122c9ecbd87f29bfebee6dbfca1a26706839a9 100644 (file)
@@ -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
   {
   };
 };
index 3d6fc04b39b9c8a686458fb93351e39583e30141..7452072486345fff7b6761e9561690e91324128e 100644 (file)
@@ -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