From: salome <> Date: Tue, 6 Dec 2005 12:09:06 +0000 (+0000) Subject: utilisation studyManager X-Git-Tag: SANDY~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=f56877f0e14d1476da48f6af76643422973e3d93;p=modules%2Feficas.git utilisation studyManager --- diff --git a/src/EFICASGUI/EFICASGUI.py b/src/EFICASGUI/EFICASGUI.py index df16a59b..cf88dce8 100644 --- a/src/EFICASGUI/EFICASGUI.py +++ b/src/EFICASGUI/EFICASGUI.py @@ -31,8 +31,10 @@ import salome sg=salome.sg sgPyQt=SalomePyQt.SalomePyQt() -import salomedsgui -aGuiDS=salomedsgui.guiDS() + + +import studyManager + print "EFicasGUI :: :::::::::::::::::::::::::::::::::::::::::::::::::::::" @@ -82,7 +84,7 @@ def setSettings(): # _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(): """ @@ -107,7 +109,7 @@ def activeStudyChanged(ID): 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): @@ -138,14 +140,14 @@ def runEficas(): #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" ) @@ -153,32 +155,36 @@ def runEficasHomard(): 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 @@ -191,7 +197,6 @@ dict_command={ 9042:runEficasFichier, } -#CS_pbruno temporaire -import studyManager #from PAL -#palStudyManager = studyManager.SalomeStudy() -palStudyManager = studyManager.study \ No newline at end of file + + + diff --git a/src/EFICASGUI/eficasSalome.py b/src/EFICASGUI/eficasSalome.py index 9a7e19ff..742817e3 100644 --- a/src/EFICASGUI/eficasSalome.py +++ b/src/EFICASGUI/eficasSalome.py @@ -155,12 +155,12 @@ class MyEficas( Tkinter.Toplevel, eficas.EFICAS ): 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 @@ -187,11 +187,11 @@ class MyEficas( Tkinter.Toplevel, eficas.EFICAS ): 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 @@ -391,20 +391,20 @@ class MyEficas( Tkinter.Toplevel, eficas.EFICAS ): #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 )