From a5fc8802cbdce2e9bb5c7d074d6d2727520114a2 Mon Sep 17 00:00:00 2001 From: salome <> Date: Wed, 2 Nov 2005 11:23:37 +0000 Subject: [PATCH] =?utf8?q?Portage=20V3:=20-=20suppression=20de=20ws=20en?= =?utf8?q?=20param=C3=A8tre=20des=20m=C3=A9thodes=20-=20impl=C3=A9mentatio?= =?utf8?q?n=20de=20la=20m=C3=A9thode=20activate?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/EFICASGUI/EFICASGUI.py | 53 +++++++++++++++++++++-------------- src/EFICASGUI/eficasSalome.py | 8 ++---- 2 files changed, 35 insertions(+), 26 deletions(-) diff --git a/src/EFICASGUI/EFICASGUI.py b/src/EFICASGUI/EFICASGUI.py index 2f933a88..d4383962 100644 --- a/src/EFICASGUI/EFICASGUI.py +++ b/src/EFICASGUI/EFICASGUI.py @@ -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, } diff --git a/src/EFICASGUI/eficasSalome.py b/src/EFICASGUI/eficasSalome.py index c30d1259..b86f9e50 100644 --- a/src/EFICASGUI/eficasSalome.py +++ b/src/EFICASGUI/eficasSalome.py @@ -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") -- 2.39.2