8 # Variable globale pour stocker le Workspace de Salome
13 # -----------------------------------------------------------------------------
20 print "lastWindowClosed()"
25 qt.QObject.connect(qt.qApp,qt.SIGNAL("lastWindowClosed()"),g)
27 # -----------------------------------------------------------------------------
32 sgPyQt=SalomePyQt.SalomePyQt()
34 aGuiDS=salomedsgui.guiDS()
35 print "EFicasGUI :: :::::::::::::::::::::::::::::::::::::::::::::::::::::"
37 # -----------------------------------------------------------------------------
39 def setWorkSpace(workSpace):
40 print "EficasGUI --- setWorkSpace"
44 print "WORKSPACE: ",WORKSPACE
48 # creation d'une message box
49 #qt.QMessageBox.information(d,"titre","message")
51 # recuperation du workspace
52 ws=sgPyQt.getMainFrame()
55 # -----------------------------------------------------------------------------
57 def OnGUIEvent(commandID) :
58 print "EficasGUI :: OnGUIEvent :::::::::::::::::::::::::::::::::commandID,WORKSPACE = ",commandID,WORKSPACE
59 if dict_command.has_key(commandID):
60 print "OnGUIEvent :::::::::: commande associée : ",commandID
61 dict_command[commandID](WORKSPACE)
63 print "Pas de commande associée a : ",commandID
65 # -----------------------------------------------------------------------------
69 Cette méthode permet les initialisations. On définit en particulier
70 l'identifiant de l'étude courante.
73 currentStudyId = sgPyQt.getStudyId()
74 print "setSettings: currentStudyId = " + str(currentStudyId)
75 # _CS_gbo_ Voir si on peut utiliser directement sgPyQt.getStudyId()
79 # -----------------------------------------------------------------------------
81 def activeStudyChanged(ID):
83 # ne marche pas car sg est supposé résider dans une etude
84 # studyId=sg.getActiveStudyId()
86 print "_CS_GBO_ : EFICASGUI.activeStudyChanged : currentStudyId = ", currentStudyId
87 print "_CS_GBO_ : EFICASGUI.activeStudyChanged : sgPyQt.getStudyId() = ", sgPyQt.getStudyId()
89 def definePopup(theContext, theObject, theParent):
90 print "EFICASGUI --- definePopup"
92 theParent = "ObjectBrowser"
93 a=salome.sg.getAllSelected()
96 return (theContext, theObject, theParent)
99 def customPopup(popup, theContext, theObject, theParent):
100 print "EFICASGUI --- customPopup"
101 popup.removeItem(99000)
102 popup.removeItem(99001)
103 popup.removeItem(99002)
104 popup.removeItem(99003)
107 # -----------------------------------------------------------------------------
112 eficasSalome.runEficas(ws,"ASTER",studyId=currentStudyId)
114 def runEficaspourHomard(ws):
116 eficasSalome.runEficas(ws,"HOMARD")
118 def runEficasHomard(ws):
120 eficasSalome.runEficas(None,"HOMARD")
122 def runEficasFichier(ws):
124 Lancement d'eficas à partir d'un fichier sélectionné dans l'arbre
127 print "runEficasFichier"
130 a=salome.sg.getAllSelected()
132 aGuiDS.setCurrentStudy(currentStudyId)
133 boo,attr=aGuiDS.getExternalFileAttribute("FICHIER_EFICAS_ASTER",a[0])
137 boo,attr=aGuiDS.getExternalFileAttribute("FICHIER_EFICAS_HOMARD",a[0])
140 eficasSalome.runEficas(ws,code,attr,studyId=currentStudyId)
146 946:runEficaspourHomard,
148 4046:runEficaspourHomard,
149 9042:runEficasFichier,