if param_input_tc is None:
raise Exception ("Internal error: No typecode found for type 'SALOME_TYPES/ParametricInput'")
foreach = pilot.ForEachLoop("ForEach", param_input_tc)
- foreach.edGetNbOfBranchesPort().edInit(param_study.get_exec_param("NUMBER_OF_PARALLEL_COMPUTATIONS"))
+ foreach.edGetNbOfBranchesPort().edInit(param_study.nb_parallel_computations)
proc.edAddChild(foreach)
- solver_code = param_study.get_exec_param("SOLVER_CODE")
+ solver_code = param_study.salome_component_name
solver_compo_inst = proc.createComponentInstance(solver_code)
solver_compo_def = self.session_catalog._componentMap[solver_code]
init_solver = solver_compo_def._serviceMap["Init"].clone(None)
init_solver.setComponent(solver_compo_inst)
init_solver.getInputPort("studyID").edInit(studyId)
- entry = self._parse_entry(param_study.get_exec_param("DETERMINISTIC_CASE_ENTRY"))
+ entry = self._parse_entry(param_study.solver_case_entry)
init_solver.getInputPort("detCaseEntry").edInit(entry)
foreach.edSetInitNode(init_solver)
# Launch computation
executor = pilot.ExecutorSwig()
executor.RunPy(proc)
- state = proc.getEffectiveState()
if proc.getEffectiveState() != pilot.DONE:
msg = proc.getErrorReport()
if msg != "":
# You should have received a copy of the GNU Lesser General Public License
# along with SALOME PARAMETRIC module. If not, see <http://www.gnu.org/licenses/>.
-SET(PYUIC_FILES wizard_ui.py varrange_ui.py)
+SET(PYUIC_FILES wizard_ui.py varrange_ui.py execparams_ui.py)
SET(INSTALL_DIR ${PYTHONDIR}/salome/parametric/gui)
FOREACH(OUTPUT ${PYUIC_FILES})
varrange.nameLabel.setText(var)
self.varwidgets[var] = varrange
self.layout().addWidget(varrange)
+ self.layout().addStretch()
def set_ranges_from_param_study(self, param_study):
for var in param_study.input_vars:
varrange.stepSpinBox.setValue(var.step)
self.varwidgets[var.name] = varrange
self.layout().addWidget(varrange)
+ self.layout().addStretch()
+++ /dev/null
-# -*- coding: utf-8 -*-
-#
-# Copyright (C) 2012 EDF
-#
-# This file is part of SALOME PARAMETRIC module.
-#
-# SALOME PARAMETRIC module is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# SALOME PARAMETRIC module is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public License
-# along with SALOME PARAMETRIC module. If not, see <http://www.gnu.org/licenses/>.
-
-import os
-import sys
-import re
-import tempfile
-
-from PyQt4.QtGui import QMessageBox
-
-import salome
-import SalomePyQt
-sgPyQt = SalomePyQt.SalomePyQt()
-
-from salome.kernel.logger import Logger
-from salome.kernel import termcolor
-logger = Logger("salome.openturns.eficas_yacs_schema.appli",
- color = termcolor.GREEN_FG)
-from salome.kernel.studyedit import getStudyEditor
-
-import eficasSalome
-
-
-class SalomeEntry:
-
- enable_salome_selection = True
- help_message = u"Une entrée de l'arbre d'étude de Salome est attendue"
-
- def __init__(self, entryStr):
- self._entry = entryStr
-
- @staticmethod
- def __convert__(entryStr):
- return SalomeEntry(entryStr)
-
- @staticmethod
- def get_selected_value(selected_entry, study_editor):
- sobj = study_editor.study.FindObjectID(selected_entry)
- name = sobj.GetName()
- return "%s (%s)" % (name, selected_entry)
-
-def parse_entry(selected_value):
- """
- Find entry if selected_value is something like "name (entry)"
- """
- entry = selected_value
- match = re.search("\((.*)\)$", entry)
- if match is not None:
- entry = match.group(1)
- return entry
-
-class EficasFrame(eficasSalome.MyEficas):
- """
- This class launches Eficas for PARAMETRIC module. The messages in this class are in
- french because they are displayed in Eficas interface.
-
- """
- def __init__(self, parent = None):
- self.codedir = os.path.dirname(__file__)
- sys.path[:0] = [self.codedir]
- eficasSalome.MyEficas.__init__(self, parent, "parametric_exec_params")
- self.editor = getStudyEditor()
-
- def selectGroupFromSalome(self, kwType = None, editor = None):
- """
- Select an entry from Salome object browser
- """
- nbEntries = salome.sg.SelectedCount()
- if nbEntries < 1:
- msg = u"Veuillez sélectionner une entrée de l'arbre d'étude de Salome"
- QMessageBox.information(self, self.tr(u"Sélection depuis Salome"), self.tr(msg))
- return [], msg
- elif nbEntries > 1:
- msg = u"Une seule entrée doit être sélectionnée dans l'arbre d'étude de Salome"
- QMessageBox.information(self, self.tr(u"Sélection depuis Salome"), self.tr(msg))
- return [], msg
- else:
- try:
- value = kwType.get_selected_value(salome.sg.getSelected(0), self.editor)
- msg = u"L'entrée de l'arbre d'étude de Salome a été sélectionnée"
- return [value], msg
- except Exception, e:
- QMessageBox.information(self, self.tr(u"Sélection depuis Salome"), self.tr(unicode(e)))
- return [], unicode(e)
-
- def get_text_jdc(self):
- """
- Return the currently edited JDC as text
- """
- editor_index = self.viewmanager.myQtab.currentIndex()
- if editor_index < 0:
- return None
- eficas_editor = self.viewmanager.dict_editors[editor_index]
- return eficas_editor.get_text_JDC(eficas_editor.format)
-
- def closeEvent(self, event):
- while self.codedir in sys.path:
- sys.path.remove(self.codedir)
- eficasSalome.MyEficas.closeEvent(self, event)
-
- def set_exec_params_from_param_study(self, param_study):
- # No clean way to load JDC directly in Eficas, use a temp file instead
- (fd, filename) = tempfile.mkstemp()
- os.close(fd)
- f = open(filename, "w")
- f.write(param_study.exec_params)
- f.close()
- self.viewmanager.handleOpen(filename)
+++ /dev/null
-# Copyright (C) 2012 EDF
-#
-# This file is part of SALOME PARAMETRIC module.
-#
-# SALOME PARAMETRIC module is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# SALOME PARAMETRIC module is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public License
-# along with SALOME PARAMETRIC module. If not, see <http://www.gnu.org/licenses/>.
-
-import os
-
-from Editeur.catadesc import CatalogDescription
-from InterfaceQT4.configuration import CONFIG_BASE
-
-class CONFIG(CONFIG_BASE):
-
- def __init__(self, appli, repIni):
- """
- This class stores the configuration parameters for Eficas
- """
- CONFIG_BASE.__init__(self, appli, repIni, '.parametric_exec_params')
-
- # Configuration parameters
- self.savedir = os.getenv("HOME")
- catapath = os.path.join(os.path.dirname(__file__), "parametric_exec_params_cata.py")
- self.catalogues = (CatalogDescription("parametric_exec_params", catapath),)
-
- def save_params(self):
- pass
-
-def make_config(appli, rep):
- return CONFIG(appli, rep)
-
-def make_config_style(appli, rep):
- return None
+++ /dev/null
-# -*- coding: utf-8 -*-
-#
-# Copyright (C) 2012 EDF
-#
-# This file is part of SALOME PARAMETRIC module.
-#
-# SALOME PARAMETRIC module is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# SALOME PARAMETRIC module is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public License
-# along with SALOME PARAMETRIC module. If not, see <http://www.gnu.org/licenses/>.
-
-from salome.parametric.gui.eficas.appli import SalomeEntry
-from Accas import *
-
-JdC = JDC_CATA(regles = (UN_PARMI('EXECUTION_PARAMETERS',)),
- )
-
-EXECUTION_PARAMETERS = PROC(
- nom = "EXECUTION_PARAMETERS", op = None,
- fr = u"Paramètres d'exécution de l'étude paramétrique",
- PARAMETRIC_STUDY_NAME = SIMP(statut = "o", typ = 'TXM',
- defaut = "Parametric Study",
- fr = u"Nom de l'étude paramétrique qui sera créée dans l'arbre d'étude de Salome"),
- SOLVER_CODE = SIMP(statut = "o", typ = 'TXM',
- defaut = "DEVIATION",
- fr = u"Nom du composant de calcul"),
- DETERMINISTIC_CASE_ENTRY = SIMP(statut = "o", typ = SalomeEntry,
- fr = u"Cas déterministe dans l'arbre d'étude de Salome"),
- NUMBER_OF_PARALLEL_COMPUTATIONS = SIMP(statut = "o", typ = 'I', defaut = 1,
- fr = u"Nombre de branches de calcul parallèles"),
-)
+++ /dev/null
-# Copyright (C) 2012 EDF
-#
-# This file is part of SALOME PARAMETRIC module.
-#
-# SALOME PARAMETRIC module is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# SALOME PARAMETRIC module is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public License
-# along with SALOME PARAMETRIC module. If not, see <http://www.gnu.org/licenses/>.
-
-code = "parametric_exec_params"
+++ /dev/null
-# Copyright (C) 2012 EDF
-#
-# This file is part of SALOME PARAMETRIC module.
-#
-# SALOME PARAMETRIC module is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# SALOME PARAMETRIC module is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public License
-# along with SALOME PARAMETRIC module. If not, see <http://www.gnu.org/licenses/>.
-
-import os
-
-repIni = os.path.dirname(__file__)
-INSTALLDIR = os.getenv("EFICAS_ROOT")
--- /dev/null
+# Copyright (C) 2012 EDF
+#
+# This file is part of SALOME PARAMETRIC module.
+#
+# SALOME PARAMETRIC module is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# SALOME PARAMETRIC module is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with SALOME PARAMETRIC module. If not, see <http://www.gnu.org/licenses/>.
+
+from PyQt4 import QtGui, QtCore
+
+import salome
+from salome.kernel.studyedit import getStudyEditor
+
+from salome.parametric.study import ParametricStudy
+from execparams_ui import Ui_ExecParams
+
+
+class ExecParamsFrame(QtGui.QWidget, Ui_ExecParams):
+
+ def __init__(self, parent = None):
+ QtGui.QWidget.__init__(self, parent)
+ self.setupUi(self)
+ self.connect(self.selectFromSalomeButton, QtCore.SIGNAL("clicked()"), self.select_from_salome)
+ self.case_entry = None
+
+ def select_from_salome(self):
+ nb_entries = salome.sg.SelectedCount()
+ if nb_entries < 1:
+ QtGui.QMessageBox.information(self, self.tr("Select from Salome"),
+ self.tr("Please select an entry in Salome Object Browser"))
+ elif nb_entries > 1:
+ QtGui.QMessageBox.information(self, self.tr("Select from Salome"),
+ self.tr("Only one entry must be selected in Salome Object Browser"))
+ else:
+ self.set_case_entry(salome.sg.getSelected(0))
+
+ def set_case_entry(self, entry):
+ self.case_entry = entry
+ self.caseEntryLE.setText(getStudyEditor().study.FindObjectID(entry).GetName() + " (" + entry + ")")
+
+ def gui_to_study(self, param_study):
+ if self.salomeComponentRB.isChecked():
+ param_study.solver_code_type = ParametricStudy.SALOME_COMPONENT
+ param_study.salome_component_name = str(self.componentNameLE.text())
+ param_study.solver_case_entry = self.case_entry
+ else:
+ param_study.solver_code_type = ParametricStudy.PYTHON_SCRIPT
+ param_study.python_script = str(self.pythonScriptTE.text())
+ param_study.name = str(self.studyNameLE.text())
+ param_study.nb_parallel_computations = self.nbParallelSB.value()
+
+ def study_to_gui(self, param_study):
+ if param_study.solver_code_type == ParametricStudy.SALOME_COMPONENT:
+ self.salomeComponentRB.setChecked(True)
+ self.componentNameLE.setText(param_study.salome_component_name)
+ self.set_case_entry(param_study.solver_case_entry)
+ else:
+ self.pythonScriptRB.setChecked(True)
+ self.pythonScriptTE.setText(param_study.python_script)
+ self.studyNameLE.setText(param_study.name)
+ self.nbParallelSB.setValue(param_study.nb_parallel_computations)
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>ExecParams</class>
+ <widget class="QWidget" name="ExecParams">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>765</width>
+ <height>720</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Execution Parameters</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <widget class="QGroupBox" name="groupBox">
+ <property name="title">
+ <string>Solver Code</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout_2">
+ <item>
+ <widget class="QRadioButton" name="salomeComponentRB">
+ <property name="text">
+ <string>SALOME Component</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ <attribute name="buttonGroup">
+ <string notr="true">solverCodeTypeBG</string>
+ </attribute>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <spacer name="horizontalSpacer_2">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::Fixed</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>25</width>
+ <height>10</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>Component Name:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="componentNameLE">
+ <property name="text">
+ <string>DEVIATION</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::Fixed</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>30</width>
+ <height>10</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_2">
+ <property name="text">
+ <string>Case Entry:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="caseEntryLE">
+ <property name="readOnly">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="selectFromSalomeButton">
+ <property name="text">
+ <string>Select </string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_4">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QRadioButton" name="pythonScriptRB">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Python Script</string>
+ </property>
+ <attribute name="buttonGroup">
+ <string notr="true">solverCodeTypeBG</string>
+ </attribute>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_2">
+ <item>
+ <spacer name="horizontalSpacer_3">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::Fixed</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>25</width>
+ <height>10</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QTextEdit" name="pythonScriptTE">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="groupBox_2">
+ <property name="title">
+ <string>Other Parameters</string>
+ </property>
+ <layout class="QFormLayout" name="formLayout">
+ <item row="0" column="1">
+ <widget class="QLineEdit" name="studyNameLE">
+ <property name="text">
+ <string>Parametric Study</string>
+ </property>
+ </widget>
+ </item>
+ <item row="6" column="0">
+ <widget class="QLabel" name="label_4">
+ <property name="text">
+ <string>Number of Parallel Computations:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="0">
+ <widget class="QLabel" name="label_3">
+ <property name="text">
+ <string>Parametric Study Name:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="6" column="1">
+ <widget class="QSpinBox" name="nbParallelSB">
+ <property name="minimum">
+ <number>1</number>
+ </property>
+ <property name="maximum">
+ <number>1000000</number>
+ </property>
+ <property name="value">
+ <number>1</number>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+ <buttongroups>
+ <buttongroup name="solverCodeTypeBG"/>
+ </buttongroups>
+</ui>
def new_study(self):
wizard = Wizard(sgPyQt.getDesktop())
- id = sgPyQt.createView("New Parametric Study", wizard)
- wizard.view_id = id
+ view_id = sgPyQt.createView("New Parametric Study", wizard)
+ wizard.view_id = view_id
def edit_study(self, param_study):
wizard = Wizard(sgPyQt.getDesktop())
wizard.set_study(param_study)
- id = sgPyQt.createView(param_study.get_exec_param("PARAMETRIC_STUDY_NAME"), wizard)
- wizard.view_id = id
+ view_id = sgPyQt.createView(param_study.name, wizard)
+ wizard.view_id = view_id
from wizard_ui import Ui_Wizard
from selectvars import SelectVarsFrame
from definevalues import DefineValuesFrame
-from salome.parametric.gui.eficas.appli import EficasFrame
+from execparams import ExecParamsFrame
from salome.parametric.study import ParametricVariable, ParametricStudy, ParametricStudyEditor
self.stepLayout.addWidget(self.step_labels[i])
self.select_vars_frame = SelectVarsFrame(self)
self.define_values_frame = DefineValuesFrame(self)
- self.exec_params_frame = EficasFrame(self)
+ self.exec_params_frame = ExecParamsFrame(self)
self.step_frames = [self.select_vars_frame,
self.define_values_frame,
self.exec_params_frame]
param_study = ParametricStudy()
# Input variables
for (name, range_widget) in self.define_values_frame.varwidgets.iteritems():
- min = range_widget.fromSpinBox.value()
- max = range_widget.toSpinBox.value()
+ minval = range_widget.fromSpinBox.value()
+ maxval = range_widget.toSpinBox.value()
step = range_widget.stepSpinBox.value()
- var = ParametricVariable(name, min, max, step)
+ var = ParametricVariable(name, minval, maxval, step)
param_study.add_input_variable(var)
# Output variables
exch_vars = self.select_vars_frame.getSelectedExchangeVariables()
for outvar in exch_vars.outputVarList:
param_study.add_output_variable(outvar.name)
# Execution parameters
- exec_params_comm = self.exec_params_frame.get_text_jdc()
- param_study.set_exec_params(exec_params_comm)
+ self.exec_params_frame.gui_to_study(param_study)
+
# Save to Salome study
ed = ParametricStudyEditor()
if self.entry is not None:
self.entry = param_study.entry
self.select_vars_frame.set_vars_from_param_study(param_study)
self.define_values_frame.set_ranges_from_param_study(param_study)
- self.exec_params_frame.set_exec_params_from_param_study(param_study)
+ self.exec_params_frame.study_to_gui(param_study)
def close(self):
QtGui.QWidget.close(self)
</item>
<item>
<widget class="QFrame" name="innerFrame">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3"/>
</widget>
</item>
- <item>
- <spacer name="verticalSpacer">
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>198</height>
- </size>
- </property>
- </spacer>
- </item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
PARAM_STUDY_ICON = "param_study.png"
PARAM_STUDY_TYPE_ID = 1
-def jdc_to_dict(jdc, command_list):
- """
- This tricky function transforms a JdC with a single command into a
- dictionary that can be used more easily from a Python context (thanks to
- M. Courtois and G. Boulant).
- """
- context = {}
- for command in command_list:
- context[command] = _args_to_dict
- exec "parameters = " + jdc.strip() in context
- return context['parameters']
-
-def _args_to_dict(**kwargs):
- return kwargs
-
class ParametricStudyEditor:
"""
This class provides utility methods to edit the component "Parametric" in
def _set_sobj(self, parametric_study, sobj):
self.editor.setItem(sobj,
- name = parametric_study.get_exec_param("PARAMETRIC_STUDY_NAME"),
+ name = parametric_study.name,
comment = cPickle.dumps(parametric_study),
icon = PARAM_STUDY_ICON,
typeId = PARAM_STUDY_TYPE_ID)
class ParametricVariable:
- def __init__(self, name, min = None, max = None, step = None):
+ def __init__(self, name, minval = None, maxval = None, step = None):
self.name = name
- self.min = min
- self.max = max
+ self.min = minval
+ self.max = maxval
self.step = step
class ParametricStudy:
+
+ SALOME_COMPONENT = 0
+ PYTHON_SCRIPT = 1
def __init__(self):
self.input_vars = []
self.output_vars = []
- self.exec_params = None
+ self.solver_code_type = ParametricStudy.SALOME_COMPONENT
+ self.salome_component_name = None
+ self.solver_case_entry = None
+ self.python_script = None
+ self.name = None
+ self.nb_parallel_computations = 1
self.data = None
self.datasize = 0
self._value_dict = None
def add_output_variable(self, varname):
self.output_vars.append(varname)
- def set_exec_params(self, params):
- self.exec_params = params
-
- def get_exec_param(self, name):
- param_dict = jdc_to_dict(self.exec_params, ["EXECUTION_PARAMETERS"])
- return param_dict[name]
-
def generate_data(self):
self.data = {}
self.datasize = 0