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 :: :::::::::::::::::::::::::::::::::::::::::::::::::::::"
38 # -----------------------------------------------------------------------------
40 def setWorkSpace(workSpace):
41 print "EficasGUI --- setWorkSpace"
45 print "WORKSPACE: ",WORKSPACE
47 desktop=sgPyQt.getDesktop()
49 # creation d'une message box
50 #qt.QMessageBox.information(d,"titre","message")
52 # recuperation du workspace
53 ws=sgPyQt.getMainFrame()
56 # -----------------------------------------------------------------------------
58 def OnGUIEvent(commandID) :
59 print "EficasGUI :: OnGUIEvent :::::::::::::::::::::::::::::::::commandID,WORKSPACE = ",commandID,WORKSPACE
60 if dict_command.has_key(commandID):
61 print "OnGUIEvent :::::::::: commande associée : ",commandID
62 dict_command[commandID](WORKSPACE)
64 print "Pas de commande associée a : ",commandID
66 # -----------------------------------------------------------------------------
70 Cette méthode permet les initialisations. On définit en particulier
71 l'identifiant de l'étude courante.
74 desktop=sgPyQt.getDesktop()
76 currentStudyId = sgPyQt.getStudyId()
77 print "setSettings: currentStudyId = " + str(currentStudyId)
78 # _CS_gbo_ Voir si on peut utiliser directement sgPyQt.getStudyId()
82 # -----------------------------------------------------------------------------
84 def activeStudyChanged(ID):
86 desktop=sgPyQt.getDesktop()
88 # ne marche pas car sg est supposé résider dans une etude
89 # studyId=sg.getActiveStudyId()
91 print "_CS_GBO_ : EFICASGUI.activeStudyChanged : currentStudyId = ", currentStudyId
92 print "_CS_GBO_ : EFICASGUI.activeStudyChanged : sgPyQt.getStudyId() = ", sgPyQt.getStudyId()
94 def definePopup(theContext, theObject, theParent):
95 print "EFICASGUI --- definePopup"
97 theParent = "ObjectBrowser"
98 a=salome.sg.getAllSelected()
101 return (theContext, theObject, theParent)
104 def customPopup(popup, theContext, theObject, theParent):
105 print "EFICASGUI --- customPopup"
106 popup.removeItem(99000)
107 popup.removeItem(99001)
108 popup.removeItem(99002)
109 popup.removeItem(99003)
112 # -----------------------------------------------------------------------------
117 print "--------------------------------------------------"
119 eficasSalome.runEficas(ws,"ASTER",studyId=currentStudyId)
121 def runEELIH(ws,code="ASTER"):
122 # Enregistrement dans l étude
125 print "++++++++++++++++++++++++++++++++++++++++++++++++++++"
128 MaRef=eficasEtude.Eficas_In_Study(code,studyId=currentStudyId)
129 # flag = E pour Eficas (enregistrement manuel du fichier de commandes)
131 moi=appli.Appli(MaRef, flag)
133 def runEficaspourHomard(ws):
135 eficasSalome.runEficas(ws,"HOMARD")
137 def runEficasHomard(ws):
139 eficasSalome.runEficas(None,"HOMARD")
141 def runEficasFichier(ws):
143 Lancement d'eficas à partir d'un fichier sélectionné dans l'arbre
146 print "runEficasFichier"
149 a=salome.sg.getAllSelected()
151 aGuiDS.setCurrentStudy(currentStudyId)
152 boo,attr=aGuiDS.getExternalFileAttribute("FICHIER_EFICAS_ASTER",a[0])
156 boo,attr=aGuiDS.getExternalFileAttribute("FICHIER_EFICAS_HOMARD",a[0])
159 eficasSalome.runEficas(ws,code,attr,studyId=currentStudyId)
166 946:runEficaspourHomard,
169 4046:runEficaspourHomard,
170 9042:runEficasFichier,