8 # Variable globale pour stocker le Workspace de Salome
14 # -----------------------------------------------------------------------------
21 print "lastWindowClosed()"
26 qt.QObject.connect(qt.qApp,qt.SIGNAL("lastWindowClosed()"),g)
28 # -----------------------------------------------------------------------------
33 sgPyQt=SalomePyQt.SalomePyQt()
35 aGuiDS=salomedsgui.guiDS()
36 print "EFicasGUI :: :::::::::::::::::::::::::::::::::::::::::::::::::::::"
39 # -----------------------------------------------------------------------------
40 # gestionnaire arbre d'étude
41 from EficasStudy import study
44 # -----------------------------------------------------------------------------
45 #Cette méthode est obsolète en V3
46 #En V2, si on n'implémente pas cette méthode, le composant fonctionne
47 #correctement. Un message "Attribute Error" apparait dans la trace.
48 def setWorkSpace(workSpace):
49 print "EficasGUI --- setWorkSpace"
53 print "WORKSPACE: ",WORKSPACE
55 desktop=sgPyQt.getDesktop()
57 # creation d'une message box
58 #qt.QMessageBox.information(d,"titre","message")
60 # recuperation du workspace
61 ws=sgPyQt.getMainFrame()
64 # -----------------------------------------------------------------------------
66 def OnGUIEvent(commandID) :
67 print "EficasGUI :: OnGUIEvent :::::::::::::::::::::::::::::::::commandID = ",commandID
68 if dict_command.has_key(commandID):
69 print "OnGUIEvent :::::::::: commande associée : ",commandID
70 dict_command[commandID]()
72 print "Pas de commande associée a : ",commandID
74 # -----------------------------------------------------------------------------
78 Cette méthode permet les initialisations. On définit en particulier
79 l'identifiant de l'étude courante.
82 desktop=sgPyQt.getDesktop()
84 currentStudyId = sgPyQt.getStudyId()
85 print "setSettings: currentStudyId = " + str(currentStudyId)
86 # _CS_gbo_ Voir si on peut utiliser directement sgPyQt.getStudyId()
88 study.setCurrentStudyID( currentStudyId )
92 Cette méthode permet l'activation du module, s'il a été chargé mais pas encore
93 activé dans une étude précédente.
97 print "--------EFICASGUI:: activate"
101 # -----------------------------------------------------------------------------
103 def activeStudyChanged(ID):
105 desktop=sgPyQt.getDesktop()
106 global currentStudyId
107 # ne marche pas car sg est supposé résider dans une etude
108 # studyId=sg.getActiveStudyId()
110 print "_CS_GBO_ : EFICASGUI.activeStudyChanged : currentStudyId = ", currentStudyId
111 print "_CS_GBO_ : EFICASGUI.activeStudyChanged : sgPyQt.getStudyId() = ", sgPyQt.getStudyId()
112 study.setCurrentStudyID( ID )
115 def definePopup(theContext, theObject, theParent):
116 print "EFICASGUI --- definePopup"
118 theParent = "ObjectBrowser"
119 a=salome.sg.getAllSelected()
122 return (theContext, theObject, theParent)
125 def customPopup(popup, theContext, theObject, theParent):
126 print "EFICASGUI --- customPopup"
127 popup.removeItem(99000)
128 popup.removeItem(99001)
129 popup.removeItem(99002)
130 popup.removeItem(99003)
133 # -----------------------------------------------------------------------------
138 print "-------------------------EFICASGUI::runEficas-------------------------"
140 eficasSalome.runEficas("ASTER",studyId=currentStudyId)
142 def runEELIH(code="ASTER"):
143 # Enregistrement dans l étude
146 print "++++++++++++++++++++++++++++++++++++++++++++++++++++"
149 MaRef=eficasEtude.Eficas_In_Study(code,studyId=currentStudyId)
150 # flag = E pour Eficas (enregistrement manuel du fichier de commandes)
152 moi=appli.Appli(MaRef, flag)
154 def runEficaspourHomard():
156 eficasSalome.runEficas("HOMARD")
158 def runEficasHomard():
160 eficasSalome.runEficas("HOMARD")
162 def runEficasFichier():
164 Lancement d'eficas à partir d'un fichier sélectionné dans l'arbre
167 print "runEficasFichier"
170 a=salome.sg.getAllSelected()
172 aGuiDS.setCurrentStudy(currentStudyId)
173 boo,attr=aGuiDS.getExternalFileAttribute("FICHIER_EFICAS_ASTER",a[0])
177 boo,attr=aGuiDS.getExternalFileAttribute("FICHIER_EFICAS_HOMARD",a[0])
180 eficasSalome.runEficas(code,attr,studyId=currentStudyId)
187 946:runEficaspourHomard,
190 4046:runEficaspourHomard,
191 9042:runEficasFichier,