Salome HOME
Portage V3: EFICAS_before_burge
authorsalome <>
Wed, 2 Nov 2005 11:23:37 +0000 (11:23 +0000)
committersalome <>
Wed, 2 Nov 2005 11:23:37 +0000 (11:23 +0000)
- suppression de ws en paramètre des méthodes
- implémentation de la méthode activate

src/EFICASGUI/EFICASGUI.py
src/EFICASGUI/eficasSalome.py

index 2f933a88acb08935a18e26df27e1bb42a4f1f5fe..d438396255732664a4b54e2e0170e78bd401a53d 100644 (file)
@@ -36,14 +36,15 @@ aGuiDS=salomedsgui.guiDS()
 print "EFicasGUI :: :::::::::::::::::::::::::::::::::::::::::::::::::::::"
 
 
-
 # -----------------------------------------------------------------------------
 # gestionnaire arbre d'étude
 from EficasStudy import study
 
 
 # -----------------------------------------------------------------------------
-
+#Cette méthode est obsolète en V3
+#En V2, si on n'implémente pas cette méthode, le composant fonctionne
+#correctement. Un message "Attribute Error" apparait dans la trace.
 def setWorkSpace(workSpace):
    print "EficasGUI --- setWorkSpace"
    global WORKSPACE
@@ -63,10 +64,10 @@ def setWorkSpace(workSpace):
 # -----------------------------------------------------------------------------
 
 def OnGUIEvent(commandID) :
-   print "EficasGUI :: OnGUIEvent :::::::::::::::::::::::::::::::::commandID,WORKSPACE = ",commandID,WORKSPACE
+   print "EficasGUI :: OnGUIEvent :::::::::::::::::::::::::::::::::commandID = ",commandID
    if dict_command.has_key(commandID):
       print "OnGUIEvent ::::::::::  commande associée  : ",commandID      
-      dict_command[commandID](WORKSPACE)
+      dict_command[commandID]()
    else:
       print "Pas de commande associée a : ",commandID
 
@@ -86,6 +87,16 @@ def setSettings():
    # dans salomedsgui?   
    study.setCurrentStudyID( currentStudyId )
 
+def activate():
+   """
+   Cette méthode permet l'activation du module, s'il a été chargé mais pas encore
+   activé dans une étude précédente.
+   
+   Portage V3.
+   """
+   print "--------EFICASGUI:: activate"
+   setSettings()
+
 
 # -----------------------------------------------------------------------------
 
@@ -123,12 +134,12 @@ def customPopup(popup, theContext, theObject, theParent):
 
 import eficasSalome
 
-def runEficas(ws):
-   print "--------------------------------------------------"
+def runEficas():
+   print "-------------------------EFICASGUI::runEficas-------------------------"
    print currentStudyId
-   eficasSalome.runEficas(ws,"ASTER",studyId=currentStudyId)
+   eficasSalome.runEficas("ASTER",studyId=currentStudyId)
    
-def runEELIH(ws,code="ASTER"):
+def runEELIH(code="ASTER"):
    # Enregistrement dans l étude
    import eficasEtude
    import appli
@@ -140,15 +151,15 @@ def runEELIH(ws,code="ASTER"):
    flag = 'E'
    moi=appli.Appli(MaRef, flag)
    
-def runEficaspourHomard(ws):
+def runEficaspourHomard():
    print "runEficas"
-   eficasSalome.runEficas(ws,"HOMARD")
+   eficasSalome.runEficas("HOMARD")
     
-def runEficasHomard(ws):
+def runEficasHomard():
    print "runEficas"
-   eficasSalome.runEficas(None,"HOMARD")
+   eficasSalome.runEficas("HOMARD")
 
-def runEficasFichier(ws):
+def runEficasFichier():
    """
    Lancement d'eficas à partir d'un fichier sélectionné dans l'arbre
    d'étude. 
@@ -166,17 +177,17 @@ def runEficasFichier(ws):
          boo,attr=aGuiDS.getExternalFileAttribute("FICHIER_EFICAS_HOMARD",a[0])
         code = "HOMARD"
    
-   eficasSalome.runEficas(ws,code,attr,studyId=currentStudyId)
+   eficasSalome.runEficas(code,attr,studyId=currentStudyId)
 
 # Partie applicative
 
 dict_command={
-               941:runEficas,
-              943:runEELIH,
-               946:runEficaspourHomard,
-               4041:runEficas,
-              4043:runEELIH,
-               4046:runEficaspourHomard,
-               9042:runEficasFichier,
+                941:runEficas,
+                943:runEELIH,
+                946:runEficaspourHomard,
+                4041:runEficas,
+                4043:runEELIH,
+                4046:runEficaspourHomard,
+                9042:runEficasFichier,
              }
 
index c30d1259415ea8b669274dccc068a1d67bdcdbf6..b86f9e50c681324aa751442134ede29b5fde7697 100644 (file)
@@ -18,8 +18,7 @@ import Tkinter
 root=Tkinter.Tk()
 root.withdraw()
 
-
-def runEficas(ws,code="ASTER",fichier=None,studyId=None):
+def runEficas(code="ASTER",fichier=None,studyId=None):
     global initialised
     if not initialised:
         t=Tkinter.Toplevel()
@@ -32,8 +31,7 @@ def runEficas(ws,code="ASTER",fichier=None,studyId=None):
         #initialised=1
 
 def runHomard() :
-    runEficas(None,"HOMARD")
+    runEficas("HOMARD")
 
 def runAster() :
-    runEficas(None,"ASTER")
-
+    runEficas("ASTER")