From: pascale.noyret Date: Mon, 20 Aug 2018 15:47:51 +0000 (+0200) Subject: disparation de la study X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=e5de94397a95a3a43d7af116db11cab95497ca65;p=modules%2Feficas.git disparation de la study --- diff --git a/src/EFICASGUI/EFICASGUI.py b/src/EFICASGUI/EFICASGUI.py index 289db796..156c9f06 100644 --- a/src/EFICASGUI/EFICASGUI.py +++ b/src/EFICASGUI/EFICASGUI.py @@ -103,25 +103,26 @@ class GUIcontext: ################################################ # study-to-context map -__study2context__ = {} +#__study2context__ = {} # current context -__current_context__ = None +#__current_context__ = None + # ## # set and return current GUI context # study ID is passed as parameter # ## -def _setContext(studyID): - global eficasRoot - if eficasRoot is None: - return - global __study2context__, __current_context__ - if studyID not in __study2context__: - __study2context__[studyID] = GUIcontext() - pass - __current_context__ = __study2context__[studyID] - return __current_context__ +#def _setContext(studyID): +# global eficasRoot +# if eficasRoot is None: +# return +# global __study2context__, __current_context__ +# if studyID not in __study2context__: +# __study2context__[studyID] = GUIcontext() +# pass +# __current_context__ = __study2context__[studyID] +# return __current_context__ # ----------------------------------------------------------------------------- @@ -136,11 +137,11 @@ def OnGUIEvent(commandID): # ----------------------------------------------------------------------------- -def setSettings(): - """ - Cette méthode permet les initialisations. - """ - _setContext(sgPyQt.getStudyId()) +#def setSettings(): +# """ +# Cette méthode permet les initialisations. +# """ + #_setContext(sgPyQt.getStudyId()) def activate(): @@ -150,13 +151,14 @@ def activate(): Portage V3. """ - setSettings() +# setSettings() + GUIcontext() # ----------------------------------------------------------------------------- -def activeStudyChanged(ID): - _setContext(ID) +#def activeStudyChanged(ID): +# _setContext(ID) # ----------------------------------------------------------------------------- diff --git a/src/STUDY/EficasStudy.py b/src/STUDY/EficasStudy.py index c191b112..0d344800 100644 --- a/src/STUDY/EficasStudy.py +++ b/src/STUDY/EficasStudy.py @@ -18,6 +18,15 @@ SGeom = "Geometry" SVisu = "Post-Pro" SAster = "Aster" +__study__ = None +def getStudy(): + global __study__ + if __study__ is None: + obj = getNS().Resolve( '/Study' ) + __study__ = obj._narrow( SALOMEDS.Study ) + pass + return __study__ + class SalomeStudy(salomedsgui.guiDS): """ @@ -29,9 +38,11 @@ class SalomeStudy(salomedsgui.guiDS): une étude courante ( positionnée dans le constructeur ou par la méthode setCurrentStudyID() ) """ - def __init__(self, studyID=salome.myStudyId): + #def __init__(self, studyID=salome.myStudyId): + def __init__(self): salomedsgui.guiDS.__init__(self) - self.setCurrentStudy(studyID) + #self.setCurrentStudy(studyID) + self.setCurrentStudy() # spécifique méthode __getMeshType() : self.groupOp = None @@ -117,11 +128,11 @@ class SalomeStudy(salomedsgui.guiDS): """ self._father = None self._component = None - self._myStudy = self._myStudyManager.GetStudyByID(studyID) + self.myStudy = getStudy() self._myBuilder = self._myStudy.NewBuilder() salome.myStudy = self._myStudy - salome.myStudyId = studyID + #salome.myStudyId = studyID salome.myStudyName = self._myStudy._get_Name() def refresh(self): @@ -250,7 +261,6 @@ class SalomeStudy(salomedsgui.guiDS): # import sys # ex_type = sys.exc_info()[0] # ex_value = sys.exc_info()[1] - # print('>>>>CS_Pbruno StudyTree.getMainShapeEntry( entry = %s ) ' %entry) # print('type = %s , value = %s '%( ex_type, ex_value )) result = None @@ -281,7 +291,6 @@ class SalomeStudy(salomedsgui.guiDS): # import sys # ex_type = sys.exc_info()[0] # ex_value = sys.exc_info()[1] - # print('>>>>CS_Pbruno StudyTree.sameMainShape( shapeEntry1 = %s , shapeEntry2 = %s )'%( shapeEntry1, shapeEntry2 )) # print('type = %s , value = %s '%( ex_type, ex_value )) result = None