]> SALOME platform Git repositories - modules/eficas.git/commitdiff
Salome HOME
disparation de la study V9_dev origin/V9_dev
authorpascale.noyret <pascale.noyret@edf.fr>
Mon, 20 Aug 2018 15:47:51 +0000 (17:47 +0200)
committerpascale.noyret <pascale.noyret@edf.fr>
Mon, 20 Aug 2018 15:47:51 +0000 (17:47 +0200)
src/EFICASGUI/EFICASGUI.py
src/STUDY/EficasStudy.py

index 289db796af117109a51f89146e68dea86f0b47d8..156c9f06372cdeb3cfc992f33156d6cede076230 100644 (file)
@@ -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)
 
 
 # -----------------------------------------------------------------------------
index c191b11201dbc19d027380569f024ecc64b766ee..0d344800cd62181cb2e584f5a7d2f04c8e4398f3 100644 (file)
@@ -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