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()
38 print "EFicasGUI :: :::::::::::::::::::::::::::::::::::::::::::::::::::::"
42 # -----------------------------------------------------------------------------
43 #Cette méthode est obsolète en V3
44 #En V2, si on n'implémente pas cette méthode, le composant fonctionne
45 #correctement. Un message "Attribute Error" apparait dans la trace.
46 def setWorkSpace(workSpace):
47 print "EficasGUI --- setWorkSpace"
51 print "WORKSPACE: ",WORKSPACE
53 desktop=sgPyQt.getDesktop()
55 # creation d'une message box
56 #qt.QMessageBox.information(d,"titre","message")
58 # recuperation du workspace
59 ws=sgPyQt.getMainFrame()
62 # -----------------------------------------------------------------------------
64 def OnGUIEvent(commandID) :
65 print "EficasGUI :: OnGUIEvent :::::::::::::::::::::::::::::::::commandID = ",commandID
66 if dict_command.has_key(commandID):
67 print "OnGUIEvent :::::::::: commande associée : ",commandID
68 dict_command[commandID]()
70 print "Pas de commande associée a : ",commandID
72 # -----------------------------------------------------------------------------
76 Cette méthode permet les initialisations. On définit en particulier
77 l'identifiant de l'étude courante.
80 desktop=sgPyQt.getDesktop()
82 currentStudyId = sgPyQt.getStudyId()
83 print "setSettings: currentStudyId = " + str(currentStudyId)
84 # _CS_gbo_ Voir si on peut utiliser directement sgPyQt.getStudyId()
87 studyManager.palStudy.setCurrentStudyID( currentStudyId ) #CS_pbruno
91 Cette méthode permet l'activation du module, s'il a été chargé mais pas encore
92 activé dans une étude précédente.
96 print "--------EFICASGUI:: activate"
100 # -----------------------------------------------------------------------------
102 def activeStudyChanged(ID):
104 desktop=sgPyQt.getDesktop()
105 global currentStudyId
106 # ne marche pas car sg est supposé résider dans une etude
107 # studyId=sg.getActiveStudyId()
109 print "_CS_GBO_ : EFICASGUI.activeStudyChanged : currentStudyId = ", currentStudyId
110 print "_CS_GBO_ : EFICASGUI.activeStudyChanged : sgPyQt.getStudyId() = ", sgPyQt.getStudyId()
112 studyManager.palStudy.setCurrentStudyID( currentStudyId ) #CS_pbruno
115 def definePopup(theContext, theObject, theParent):
116 print "EFICASGUI --- definePopup"
119 theParent = "ObjectBrowser"
120 a=salome.sg.getAllSelected()
124 aType, aValue = studyManager.palStudy.getTypeAndValue( selectedEntry )
126 if aType == studyManager.FICHIER_EFICAS_ASTER or aType == studyManager.FICHIER_EFICAS_HOMARD:
129 return (theContext, theObject, theParent)
132 def customPopup(popup, theContext, theObject, theParent):
133 print "EFICASGUI --- customPopup"
134 popup.removeItem(99000)
135 popup.removeItem(99001)
136 popup.removeItem(99002)
137 popup.removeItem(99003)
140 # -----------------------------------------------------------------------------
145 print "-------------------------EFICASGUI::runEficas-------------------------"
147 #eficasSalome.runEficas("ASTER",studyId=currentStudyId)
148 #ws = sgPyQt.getMainFrame()
149 #desktop=sgPyQt.getDesktop()
150 eficasSalome.runEficas( "ASTER" )
153 def runEficaspourHomard():
155 #eficasSalome.runEficas("HOMARD")
156 desktop=sgPyQt.getDesktop()
157 eficasSalome.runEficas( "HOMARD" )
161 def runEficasHomard():
163 #eficasSalome.runEficas("HOMARD")
164 #desktop=sgPyQt.getDesktop()
165 eficasSalome.runEficas( "HOMARD" )
169 def runEficasFichier():
171 Lancement d'eficas pour ASTER
172 si un fichier est sélectionné, il est ouvert dans eficas
174 print "runEficasFichier"
177 a=salome.sg.getAllSelected()
179 #studyManager.palStudy.setCurrentStudyID( currentStudyId )
180 #boo,attr=aGuiDS.getExternalFileAttribute("FICHIER_EFICAS_ASTER",a[0])
183 aType, aValue = studyManager.palStudy.getTypeAndValue( selectedEntry )
184 if aType == studyManager.FICHIER_EFICAS_ASTER:
187 elif aType == studyManager.FICHIER_EFICAS_HOMARD:
194 #eficasSalome.runEficas(code,attr,studyId=currentStudyId)
195 #desktop=sgPyQt.getDesktop()
196 eficasSalome.runEficas( code, fileName )
204 941:runEficasFichier,# runEficas,
205 946:runEficaspourHomard,
206 4041:runEficasFichier, #runEficas,
207 4046:runEficaspourHomard,
208 9042:runEficasFichier,