sg=salome.sg
sgPyQt=SalomePyQt.SalomePyQt()
-import salomedsgui
-aGuiDS=salomedsgui.guiDS()
+
+
+import studyManager
+
print "EFicasGUI :: :::::::::::::::::::::::::::::::::::::::::::::::::::::"
# _CS_gbo_ Voir si on peut utiliser directement sgPyQt.getStudyId()
# dans salomedsgui?
- palStudyManager.setCurrentStudyID( currentStudyId ) #CS_pbruno
+ studyManager.palStudy.setCurrentStudyID( currentStudyId ) #CS_pbruno
def activate():
"""
print "_CS_GBO_ : EFICASGUI.activeStudyChanged : currentStudyId = ", currentStudyId
print "_CS_GBO_ : EFICASGUI.activeStudyChanged : sgPyQt.getStudyId() = ", sgPyQt.getStudyId()
- palStudyManager.setCurrentStudyID( currentStudyId ) #CS_pbruno
+ studyManager.palStudy.setCurrentStudyID( currentStudyId ) #CS_pbruno
def definePopup(theContext, theObject, theParent):
#eficasSalome.runEficas("ASTER",studyId=currentStudyId)
#ws = sgPyQt.getMainFrame()
desktop=sgPyQt.getDesktop()
- eficasSalome.runEficas( desktop, palStudyManager, "ASTER" )
+ eficasSalome.runEficas( desktop, studyManager.palStudy, "ASTER" )
def runEficaspourHomard():
print "runEficas"
#eficasSalome.runEficas("HOMARD")
desktop=sgPyQt.getDesktop()
- eficasSalome.runEficas( desktop, palStudyManager, "HOMARD" )
+ eficasSalome.runEficas( desktop, studyManager.palStudy, "HOMARD" )
print "runEficas"
#eficasSalome.runEficas("HOMARD")
desktop=sgPyQt.getDesktop()
- eficasSalome.runEficas( desktop, palStudyManager, "HOMARD" )
+ eficasSalome.runEficas( desktop, studyManager.palStudy, "HOMARD" )
def runEficasFichier():
"""
Lancement d'eficas à partir d'un fichier sélectionné dans l'arbre
- d'étude.
+ d'étude par clique droit de la souris.
"""
print "runEficasFichier"
- attr=None
- code=None
+ fileName = None
+ code = None
a=salome.sg.getAllSelected()
if len(a) == 1:
- aGuiDS.setCurrentStudy(currentStudyId)
- boo,attr=aGuiDS.getExternalFileAttribute("FICHIER_EFICAS_ASTER",a[0])
- if boo :
- code = "ASTER"
- else :
- boo,attr=aGuiDS.getExternalFileAttribute("FICHIER_EFICAS_HOMARD",a[0])
- if boo:
- code = "HOMARD"
+ #studyManager.palStudy.setCurrentStudyID( currentStudyId )
+ #boo,attr=aGuiDS.getExternalFileAttribute("FICHIER_EFICAS_ASTER",a[0])
+ selectedEntry = a[0]
+
+ aType, aValue = studyManager.palStudy.getTypeAndValue( selectedEntry )
+ if aType == studyManager.FICHIER_EFICAS_ASTER:
+ fileName = aValue
+ code = "ASTER"
+ elif aType == studyManager.FICHIER_EFICAS_HOMARD:
+ fileName = aValue
+ code = "HOMARD"
if code:
#eficasSalome.runEficas(code,attr,studyId=currentStudyId)
- desktop=sgPyQt.getDesktop()
- eficasSalome.runEficas( desktop, palStudyManager, code, attr )
+ desktop=sgPyQt.getDesktop()
+ eficasSalome.runEficas( desktop, studyManager.palStudy, code, fileName )
+
# Partie applicative
9042:runEficasFichier,
}
-#CS_pbruno temporaire
-import studyManager #from PAL
-#palStudyManager = studyManager.SalomeStudy()
-palStudyManager = studyManager.study
\ No newline at end of file
+
+
+
if not self.mainShapeEntries.has_key( jdcID ):
self.mainShapeEntries[ jdcID ] = selectedMainShapeEntry
if selectedMainShapeEntry == self.mainShapeEntries[ jdcID ]:
- name = self.palStudyManager.getNameAttribute( selectedEntry )
+ name = self.palStudyManager.getName( selectedEntry )
self.subShapes[ selectedEntry ] = name
else:
print 'CS_pbruno pas la même mainshape selectedEntry->',selectedEntry
if not self.mainShapeNames.has_key( jdcID ):
- self.mainShapeNames[ jdcID ] = self.palStudyManager.getNameAttribute( self.mainShapeEntries[ jdcID ] )
+ self.mainShapeNames[ jdcID ] = self.palStudyManager.getName( self.mainShapeEntries[ jdcID ] )
msgError = msgSubShapeBadMainShape + self.mainShapeNames[ jdcID ]
return name, msgError
if not self.mainShapeEntries.has_key( jdcID ):
self.mainShapeEntries[ jdcID ] = selectedMainShapeEntry
if selectedMainShapeEntry == self.mainShapeEntries[ jdcID ]:
- name = self.palStudyManager.getNameAttribute( selectedEntry ) #ok test 2)
+ name = self.palStudyManager.getName( selectedEntry ) #ok test 2)
else:
print 'CS_pbruno pas la même mainshape selectedEntry ->',selectedEntry
if not self.mainShapeNames.has_key( jdcID ):
- self.mainShapeNames[ jdcID ] = self.palStudyManager.getNameAttribute( self.mainShapeEntries[ jdcID ] )
+ self.mainShapeNames[ jdcID ] = self.palStudyManager.getName( self.mainShapeEntries[ jdcID ] )
msgError = msgMeshGroupBadMainShape + self.mainShapeNames[ jdcID ]
return name, msgError
#def runEficas( palStudyManager, code="ASTER", fichier=None, studyId=None):
-def runEficas( parent = SalomePyQt.SalomePyQt().getDesktop(), palStudyManager = studyManager.study, code="ASTER", fichier=None ):
+def runEficas( parent = SalomePyQt.SalomePyQt().getDesktop(), palStudyManager = studyManager.palStudy, code="ASTER", fichier=None ):
global appli
if not appli: #une seul instance possible!
appli = MyEficas( parent, palStudyManager, code = code, fichier = fichier )
-def runHomard( parent = SalomePyQt.SalomePyQt().getDesktop(), palStudyManager = studyManager.study, code="HOMARD", fichier=None ):
+def runHomard( parent = SalomePyQt.SalomePyQt().getDesktop(), palStudyManager = studyManager.palStudy, code="HOMARD", fichier=None ):
global appli
if not appli: #une seul instance possible!
appli = MyEficas( parent, palStudyManager, code = code, fichier = fichier )
"""
-def runAster(parent = SalomePyQt.SalomePyQt().getDesktop(), palStudyManager = studyManager.study, code="ASTER", fichier=None ) :
+def runAster(parent = SalomePyQt.SalomePyQt().getDesktop(), palStudyManager = studyManager.palStudy, code="ASTER", fichier=None ) :
global appli
if not appli: #une seul instance possible!
appli = MyEficas( parent, palStudyManager, code = code, fichier = fichier )