]> SALOME platform Git repositories - modules/parametric.git/commitdiff
Salome HOME
Use FactoryServerPy instead of FactoryServer to load the engine because it's still...
authorRenaud Barate <renaud.barate@edf.fr>
Fri, 1 Mar 2013 14:15:22 +0000 (15:15 +0100)
committerRenaud Barate <renaud.barate@edf.fr>
Fri, 1 Mar 2013 14:15:22 +0000 (15:15 +0100)
src/PARAMETRIC/PARAMETRIC.py
src/salome/parametric/__init__.py
src/salome/parametric/study.py

index b821eb9b70150cc008024a17f64b4c60f90e12db..a0ed4be61b5fe3ff6cb359ba4a25f4cd5707ed7e 100644 (file)
@@ -39,7 +39,7 @@ from salome.kernel import termcolor
 logger = Logger("PARAMETRIC", color = termcolor.BLUE)
 logger.setLevel(logging.DEBUG)
 
-from salome.parametric import PARAM_STUDY_TYPE_ID, ParametricStudy, parse_entry
+from salome.parametric import PARAM_STUDY_TYPE_ID, ParametricStudy, parse_entry, PARAMETRIC_ENGINE_CONTAINER
 from salome.parametric.persistence import load_param_study_dict, save_param_study_dict
 
 # module constants
@@ -104,7 +104,8 @@ class PARAMETRIC(PARAMETRIC_ORB__POA.PARAMETRIC_Gen, SALOME_ComponentPy_i, SALOM
     """
     if salomeStudyID not in self.param_comp:
       ed = getStudyEditor(salomeStudyID)
-      self.param_comp[salomeStudyID] = ed.findOrCreateComponent(MODULE_NAME, COMPONENT_NAME, COMPONENT_ICON)
+      self.param_comp[salomeStudyID] = ed.findOrCreateComponent(MODULE_NAME, COMPONENT_NAME,
+                                                                COMPONENT_ICON, PARAMETRIC_ENGINE_CONTAINER)
     return self.param_comp[salomeStudyID]
 
   def _set_param_study_sobj(self, parametric_study, salomeStudyID, sobj):
@@ -362,7 +363,6 @@ class PARAMETRIC(PARAMETRIC_ORB__POA.PARAMETRIC_Gen, SALOME_ComponentPy_i, SALOM
         for (entry, param_study) in loaded_dict.iteritems():
           if entry.startswith(componentEntry):
             self.param_study_dict[salomeStudyID][entry] = param_study
-      print self.param_study_dict
       return 1
     except:
       logger.exception("Error while trying to load study")
index a56664d0fc554c6b1150457ad63f124933224b39..8f1dbbdddd7287e432d9a20f005f76521ded03d0 100644 (file)
@@ -19,6 +19,7 @@ import study
 import genjob
 
 PARAM_STUDY_TYPE_ID = study.PARAM_STUDY_TYPE_ID
+PARAMETRIC_ENGINE_CONTAINER = study.PARAMETRIC_ENGINE_CONTAINER
 ParametricStudy = study.ParametricStudy
 VariableRange = study.VariableRange
 ParametricStudyEditor = study.ParametricStudyEditor
index 40aa7f7588e37c3e6640d15aa1754c0642595073..d4023fef2c12575a0fcfcc8238bd7f8f47b33d3b 100644 (file)
@@ -25,6 +25,10 @@ import PARAMETRIC
 
 PARAM_STUDY_TYPE_ID = 1
 
+# We must use FactoryServerPy for now because it is the one that is used by GUI
+# when automatically loading the engine
+PARAMETRIC_ENGINE_CONTAINER = "FactoryServerPy"
+
 class ParametricStudyEditor:
   """
   This class provides utility methods to edit the component "Parametric" in
@@ -43,7 +47,7 @@ class ParametricStudyEditor:
     :return: the PARAMETRIC engine
     """
     if self.engine is None:
-      self.engine = salome.lcc.FindOrLoadComponent("FactoryServer", "PARAMETRIC")
+      self.engine = salome.lcc.FindOrLoadComponent(PARAMETRIC_ENGINE_CONTAINER, "PARAMETRIC")
     return self.engine
 
   def add_parametric_study(self, parametric_study):