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 :: :::::::::::::::::::::::::::::::::::::::::::::::::::::"
40 # -----------------------------------------------------------------------------
41 # gestionnaire arbre d'étude
42 from EficasStudy import study
45 # -----------------------------------------------------------------------------
47 def setWorkSpace(workSpace):
48 print "EficasGUI --- setWorkSpace"
52 print "WORKSPACE: ",WORKSPACE
54 desktop=sgPyQt.getDesktop()
56 # creation d'une message box
57 #qt.QMessageBox.information(d,"titre","message")
59 # recuperation du workspace
60 ws=sgPyQt.getMainFrame()
63 # -----------------------------------------------------------------------------
65 def OnGUIEvent(commandID) :
66 print "EficasGUI :: OnGUIEvent :::::::::::::::::::::::::::::::::commandID,WORKSPACE = ",commandID,WORKSPACE
67 if dict_command.has_key(commandID):
68 print "OnGUIEvent :::::::::: commande associée : ",commandID
69 dict_command[commandID](WORKSPACE)
71 print "Pas de commande associée a : ",commandID
73 # -----------------------------------------------------------------------------
77 Cette méthode permet les initialisations. On définit en particulier
78 l'identifiant de l'étude courante.
81 desktop=sgPyQt.getDesktop()
83 currentStudyId = sgPyQt.getStudyId()
84 print "setSettings: currentStudyId = " + str(currentStudyId)
85 # _CS_gbo_ Voir si on peut utiliser directement sgPyQt.getStudyId()
87 study.setCurrentStudyID( currentStudyId )
90 # -----------------------------------------------------------------------------
92 def activeStudyChanged(ID):
94 desktop=sgPyQt.getDesktop()
96 # ne marche pas car sg est supposé résider dans une etude
97 # studyId=sg.getActiveStudyId()
99 print "_CS_GBO_ : EFICASGUI.activeStudyChanged : currentStudyId = ", currentStudyId
100 print "_CS_GBO_ : EFICASGUI.activeStudyChanged : sgPyQt.getStudyId() = ", sgPyQt.getStudyId()
101 study.setCurrentStudyID( ID )
104 def definePopup(theContext, theObject, theParent):
105 print "EFICASGUI --- definePopup"
107 theParent = "ObjectBrowser"
108 a=salome.sg.getAllSelected()
111 return (theContext, theObject, theParent)
114 def customPopup(popup, theContext, theObject, theParent):
115 print "EFICASGUI --- customPopup"
116 popup.removeItem(99000)
117 popup.removeItem(99001)
118 popup.removeItem(99002)
119 popup.removeItem(99003)
122 # -----------------------------------------------------------------------------
127 print "--------------------------------------------------"
129 eficasSalome.runEficas(ws,"ASTER",studyId=currentStudyId)
131 def runEELIH(ws,code="ASTER"):
132 # Enregistrement dans l étude
135 print "++++++++++++++++++++++++++++++++++++++++++++++++++++"
138 MaRef=eficasEtude.Eficas_In_Study(code,studyId=currentStudyId)
139 # flag = E pour Eficas (enregistrement manuel du fichier de commandes)
141 moi=appli.Appli(MaRef, flag)
143 def runEficaspourHomard(ws):
145 eficasSalome.runEficas(ws,"HOMARD")
147 def runEficasHomard(ws):
149 eficasSalome.runEficas(None,"HOMARD")
151 def runEficasFichier(ws):
153 Lancement d'eficas à partir d'un fichier sélectionné dans l'arbre
156 print "runEficasFichier"
159 a=salome.sg.getAllSelected()
161 aGuiDS.setCurrentStudy(currentStudyId)
162 boo,attr=aGuiDS.getExternalFileAttribute("FICHIER_EFICAS_ASTER",a[0])
166 boo,attr=aGuiDS.getExternalFileAttribute("FICHIER_EFICAS_HOMARD",a[0])
169 eficasSalome.runEficas(ws,code,attr,studyId=currentStudyId)
176 946:runEficaspourHomard,
179 4046:runEficaspourHomard,
180 9042:runEficasFichier,