X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FTools%2Fpadder%2Fspadderpy%2Fgui%2Fplugindialog.py;h=ba00df765c989578370e14397d8f0ae2f0b73fca;hb=e8173b4ff130ddb26d165c92403ef847fdfb8be2;hp=1d7f246ab7212b916b16032731e15e7257573df5;hpb=84cf6c491178cc4cea1be9c8b2ba4d13750d02a3;p=modules%2Fsmesh.git diff --git a/src/Tools/padder/spadderpy/gui/plugindialog.py b/src/Tools/padder/spadderpy/gui/plugindialog.py index 1d7f246ab..ba00df765 100644 --- a/src/Tools/padder/spadderpy/gui/plugindialog.py +++ b/src/Tools/padder/spadderpy/gui/plugindialog.py @@ -22,9 +22,10 @@ from qtsalome import QDialog, QIcon, Qt -from plugindialog_ui import Ui_PluginDialog -from inputdialog import InputDialog -from inputdata import InputData +from salome.smesh.spadder.gui.plugindialog_ui import Ui_PluginDialog +from salome.smesh.spadder.gui.inputdialog import InputDialog, INPUTDATA_KEY_FILES, INPUTDATA_KEY_PARAM +from salome.smesh.spadder.gui.inputdialog import PARAM_KEY_NBITER, PARAM_KEY_RMAXRMIN +from salome.smesh.spadder.gui.inputdata import InputData # __GBO__: uncomment this line and comment the previous one to use the # demo input dialog instead of the real one. #from demoinputdialog import InputDialog @@ -178,7 +179,7 @@ class PluginDialog(QDialog): servant. Note that the component is loaded on first demand, and then the reference is recycled. """ - if self.__dict__.has_key("__jobManager") and self.__jobManager is not None: + if "__jobManager" in self.__dict__ and self.__jobManager is not None: return self.__jobManager # WARN: we first have to update the SALOME components catalog @@ -218,6 +219,7 @@ class PluginDialog(QDialog): This function clears the log area and the states of the buttons """ self.__listInputData = [] + self.__dictInputParameters = {} self.__ui.txtLog.clear() self.__setGuiState(["CAN_SELECT"]) self.__isRunning = False @@ -241,7 +243,10 @@ class PluginDialog(QDialog): windows to process the validation event (see the slot onProcessInput which is connected to this event). ''' - self.__inputDialog.setData(self.__listInputData) + dictInputData = {} + dictInputData[INPUTDATA_KEY_FILES] = self.__listInputData + dictInputData[INPUTDATA_KEY_PARAM] = self.__dictInputParameters + self.__inputDialog.setData(dictInputData) self.__inputDialog.open() def onProcessInput(self): @@ -252,7 +257,10 @@ class PluginDialog(QDialog): """ # The processing simply consists in requesting the input data # from the dialog window. - self.__listInputData = self.__inputDialog.getData() + dictInputData = self.__inputDialog.getData() + self.__listInputData = dictInputData[INPUTDATA_KEY_FILES] + self.__dictInputParameters = dictInputData[INPUTDATA_KEY_PARAM] + self.__ui.lblStatusBar.setText("Input data OK") self.__log("INF: Press \"Compute\" to start the job") self.__setGuiState(["CAN_SELECT", "CAN_COMPUTE"]) @@ -283,8 +291,16 @@ class PluginDialog(QDialog): group_name = inputData.groupName) meshJobFileList.append(parameter) + # And to create a list of the additional parameters. + # WARN: the CORBA interface requires string values. + meshJobParameterList=[] + for inputParameterKey in self.__dictInputParameters: + value = self.__dictInputParameters[inputParameterKey] + parameter = MESHJOB.MeshJobParameter(name=inputParameterKey,value=str(value)) + meshJobParameterList.append(parameter) + jobManager = self.__getJobManager() - self.__jobid = jobManager.initialize(meshJobFileList, self.__configId) + self.__jobid = jobManager.initialize(meshJobFileList, meshJobParameterList, self.__configId) if self.__jobid < 0: self.__log("ERR: the job can't be initialized") self.__log("ERR: %s"%jobManager.getLastErrorMessage())