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
"""
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):
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")
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
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
: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):