From: uhz Date: Tue, 7 Mar 2017 10:59:31 +0000 (+0100) Subject: padder: rename MeshJobParameter to MeshJobFile X-Git-Tag: V8_3_0a2~6 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=12d35c6792b5630f462693f198f8a7dbff6bdf3f;p=modules%2Fsmesh.git padder: rename MeshJobParameter to MeshJobFile --- diff --git a/src/Tools/padder/meshjob/idl/CMakeLists.txt b/src/Tools/padder/meshjob/idl/CMakeLists.txt old mode 100755 new mode 100644 diff --git a/src/Tools/padder/meshjob/idl/MESHJOB.idl b/src/Tools/padder/meshjob/idl/MESHJOB.idl index 3179daff3..e37a36781 100644 --- a/src/Tools/padder/meshjob/idl/MESHJOB.idl +++ b/src/Tools/padder/meshjob/idl/MESHJOB.idl @@ -62,7 +62,7 @@ module MESHJOB enum FileType {MED_CONCRETE, MED_STEELBAR}; // This defines a single parameter for the job initialization (a med file) - struct MeshJobParameter + struct MeshJobFile { string file_name; FileType file_type; @@ -70,7 +70,7 @@ module MESHJOB }; // This defines a set of parameters for the job initialization - typedef sequence MeshJobParameterList; + typedef sequence MeshJobFileList; // This defines the result data of a job struct MeshJobResults @@ -97,7 +97,7 @@ module MESHJOB raises (SALOME::SALOME_Exception); /*! Initialize a smesh computation job and return the job identifier */ - long initialize(in MESHJOB::MeshJobParameterList meshJobParameterList, in string configId) + long initialize(in MESHJOB::MeshJobFileList meshJobFileList, in string configId) raises (SALOME::SALOME_Exception); /*! Submit the job execution and return true if submission is OK */ diff --git a/src/Tools/padder/meshjob/impl/MeshJobManager_i.cxx b/src/Tools/padder/meshjob/impl/MeshJobManager_i.cxx index 35f162be9..17d1c0fb0 100644 --- a/src/Tools/padder/meshjob/impl/MeshJobManager_i.cxx +++ b/src/Tools/padder/meshjob/impl/MeshJobManager_i.cxx @@ -167,8 +167,8 @@ static std::string REMOTE_WORKDIR("/tmp/spadder.remote.workdir."+USER); * * */ -const char * MeshJobManager_i::_writeDataFile(std::vector listConcreteMesh, - std::vector listSteelBarMesh) { +const char * MeshJobManager_i::_writeDataFile(std::vector listConcreteMesh, + std::vector listSteelBarMesh) { #ifdef WIN32 _mkdir(LOCAL_INPUTDIR.c_str()); #else @@ -281,17 +281,17 @@ bool MeshJobManager_i::configure(const char *configId, long MeshJobManager_i::JOBID_UNDEFINED = -1; /*! Initialize a smesh computation job and return the job identifier */ -CORBA::Long MeshJobManager_i::initialize(const MESHJOB::MeshJobParameterList & meshJobParameterList, +CORBA::Long MeshJobManager_i::initialize(const MESHJOB::MeshJobFileList & meshJobFileList, const char * configId) { beginService("MeshJobManager_i::initialize"); // // We first analyse the CORBA sequence to store data in C++ vectors // - std::vector listConcreteMesh; - std::vector listSteelBarMesh; - for(CORBA::ULong i=0; i listConcreteMesh; + std::vector listSteelBarMesh; + for(CORBA::ULong i=0; i _jobDateTimeMap; std::map _jobPathsMap; - const char* _writeDataFile (std::vector listConcreteMesh, - std::vector listSteelBarMesh); + const char* _writeDataFile (std::vector listConcreteMesh, + std::vector listSteelBarMesh); const char* _writeScriptFile (const char * dataFileName, const char * configId); std::vector * _getResourceNames(); diff --git a/src/Tools/padder/spadderpy/__init__.py b/src/Tools/padder/spadderpy/__init__.py index 004256778..0031b907d 100644 --- a/src/Tools/padder/spadderpy/__init__.py +++ b/src/Tools/padder/spadderpy/__init__.py @@ -53,38 +53,38 @@ def getTestPadderDataDir(): return datadir import MESHJOB # to get the enum constant values -from MESHJOB import MeshJobParameter, MeshJobParameterList +from MESHJOB import MeshJobFile, MeshJobFileList DEFAULT_CONCRETE_FILENAME=os.path.join(getTestDataDir(),'concrete.med') DEFAULT_STEELBAR_LISTFILENAME=[ os.path.join(getTestDataDir(),'ferraill.med') ] -def getMeshJobParameterList(concrete_filename=DEFAULT_CONCRETE_FILENAME, +def getMeshJobFileList(concrete_filename=DEFAULT_CONCRETE_FILENAME, steelbar_listfilename=DEFAULT_STEELBAR_LISTFILENAME): ''' This helper function creates a complete set of parameters (a - MeshJobParameterList) for a simple test case, i.e. a case with a + MeshJobFileList) for a simple test case, i.e. a case with a concrete filename and a single steelbar filename. ''' - # Note that a CORBA sequence (MeshJobParameterList) is mapped on a + # Note that a CORBA sequence (MeshJobFileList) is mapped on a # simple list in python - meshJobParameterList = [] + meshJobFileList = [] # We can add some parameters - param = MeshJobParameter( + param = MeshJobFile( file_name = concrete_filename, file_type = MESHJOB.MED_CONCRETE, group_name = "concrete") - meshJobParameterList.append(param) + meshJobFileList.append(param) for steelbar_filename in steelbar_listfilename: - param = MeshJobParameter( + param = MeshJobFile( file_name = steelbar_filename, file_type = MESHJOB.MED_STEELBAR, group_name = "steelbar") - meshJobParameterList.append(param) + meshJobFileList.append(param) - return meshJobParameterList + return meshJobFileList def getSpadderCatalogFilename(): diff --git a/src/Tools/padder/spadderpy/gui/inputdata.py b/src/Tools/padder/spadderpy/gui/inputdata.py index 2490af955..6633fb60c 100644 --- a/src/Tools/padder/spadderpy/gui/inputdata.py +++ b/src/Tools/padder/spadderpy/gui/inputdata.py @@ -25,10 +25,10 @@ from salome.kernel.datamodeler import DataModeler, TypeString, TypeInteger # __MEM__: Note that this module does not depend on the SPADDER # component on purpose (we could have use a derived structure of -# SPADDER_ORB.MeshJobParameter). This choice is made to ease the test +# SPADDER_ORB.MeshJobFile). This choice is made to ease the test # and development of the gui part of the plugin. If this data # structure becomes too important, we could make another arrangement -# and use directly a SPADDER_ORB.MeshJobParameter. +# and use directly a SPADDER_ORB.MeshJobFile. class InputData(DataModeler): MESHTYPES=Enumerate([ diff --git a/src/Tools/padder/spadderpy/gui/plugindialog.py b/src/Tools/padder/spadderpy/gui/plugindialog.py index cb26164ab..bb5c76abb 100644 --- a/src/Tools/padder/spadderpy/gui/plugindialog.py +++ b/src/Tools/padder/spadderpy/gui/plugindialog.py @@ -266,25 +266,25 @@ class PluginDialog(QDialog): # We first have to create the list of parameters for the # initialize function. For that, we have to create the files # from the mesh objects: - meshJobParameterList=[] + meshJobFileList=[] concreteIndex=0 for inputData in self.__listInputData: # For each input data, we have to create a - # MeshJobParameter and add it to the list. + # MeshJobFile and add it to the list. filename = self.__exportMesh(inputData.meshName, inputData.meshObject) if inputData.meshType == InputData.MESHTYPES.CONCRETE: filetype = MESHJOB.MED_CONCRETE else: filetype = MESHJOB.MED_STEELBAR - parameter = MESHJOB.MeshJobParameter( + parameter = MESHJOB.MeshJobFile( file_name = filename, file_type = filetype, group_name = inputData.groupName) - meshJobParameterList.append(parameter) + meshJobFileList.append(parameter) jobManager = self.__getJobManager() - self.__jobid = jobManager.initialize(meshJobParameterList, self.__configId) + self.__jobid = jobManager.initialize(meshJobFileList, self.__configId) if self.__jobid < 0: self.__log("ERR: the job can't be initialized") self.__log("ERR: %s"%jobManager.getLastErrorMessage()) diff --git a/src/Tools/padder/unittests/usecase_meshJobManager.py b/src/Tools/padder/unittests/usecase_meshJobManager.py index 8085105bd..127f32119 100644 --- a/src/Tools/padder/unittests/usecase_meshJobManager.py +++ b/src/Tools/padder/unittests/usecase_meshJobManager.py @@ -87,66 +87,66 @@ def test00_parameters(): file_concrete=os.path.join(spadder.getTestDataDir(),"concrete.med") file_steelbar=os.path.join(spadder.getTestDataDir(),"ferraill.med") - meshJobParameterList = [] - param = MESHJOB.MeshJobParameter(file_name=file_concrete, + meshJobFileList = [] + param = MESHJOB.MeshJobFile(file_name=file_concrete, file_type=MESHJOB.MED_CONCRETE, group_name="concrete") - meshJobParameterList.append(param) + meshJobFileList.append(param) - param = MESHJOB.MeshJobParameter(file_name=file_steelbar, + param = MESHJOB.MeshJobFile(file_name=file_steelbar, file_type=MESHJOB.MED_STEELBAR, group_name="steelbar") - meshJobParameterList.append(param) - return meshJobParameterList + meshJobFileList.append(param) + return meshJobFileList def test01_parameters(): """One concrete mesh and two steelbar meshes""" datadir = os.path.join(PADDERTESTDIR,"test01") - meshJobParameterList = [] + meshJobFileList = [] medfile = os.path.join(datadir,"concrete.med") - param = MESHJOB.MeshJobParameter(file_name=medfile, + param = MESHJOB.MeshJobFile(file_name=medfile, file_type=MESHJOB.MED_CONCRETE, group_name="concrete") - meshJobParameterList.append(param) + meshJobFileList.append(param) medfile = os.path.join(datadir,"ferraill.med") - param = MESHJOB.MeshJobParameter(file_name=medfile, + param = MESHJOB.MeshJobFile(file_name=medfile, file_type=MESHJOB.MED_STEELBAR, group_name="ferraill") - meshJobParameterList.append(param) + meshJobFileList.append(param) medfile = os.path.join(datadir,"ferrtran.med") - param = MESHJOB.MeshJobParameter(file_name=medfile, + param = MESHJOB.MeshJobFile(file_name=medfile, file_type=MESHJOB.MED_STEELBAR, group_name="ferrtran") - meshJobParameterList.append(param) + meshJobFileList.append(param) - return meshJobParameterList + return meshJobFileList def test02_parameters(): """One steelbar mesh only, without a concrete mesh""" datadir = os.path.join(PADDERTESTDIR,"test02") - meshJobParameterList = [] + meshJobFileList = [] medfile = os.path.join(datadir,"cadreef.med") - param = MESHJOB.MeshJobParameter(file_name=medfile, + param = MESHJOB.MeshJobFile(file_name=medfile, file_type=MESHJOB.MED_STEELBAR, group_name="cadre") - meshJobParameterList.append(param) - return meshJobParameterList + meshJobFileList.append(param) + return meshJobFileList def test03_parameters(): """One concrete mesh only, without a steelbar mesh""" datadir = os.path.join(PADDERTESTDIR,"test03") - meshJobParameterList = [] + meshJobFileList = [] medfile = os.path.join(datadir,"concrete.med") - param = MESHJOB.MeshJobParameter(file_name=medfile, + param = MESHJOB.MeshJobFile(file_name=medfile, file_type=MESHJOB.MED_CONCRETE, group_name="concrete") - meshJobParameterList.append(param) - return meshJobParameterList + meshJobFileList.append(param) + return meshJobFileList # # ======================================================================= @@ -155,15 +155,15 @@ def test03_parameters(): # # Choose here the use case -#meshJobParameterList = test00_parameters() -#meshJobParameterList = test01_parameters() -#meshJobParameterList = test02_parameters() -meshJobParameterList = test03_parameters() +#meshJobFileList = test00_parameters() +#meshJobFileList = test01_parameters() +#meshJobFileList = test02_parameters() +meshJobFileList = test03_parameters() # # Prepare, start and follow-up the job # -jobid = component.initialize(meshJobParameterList, configId) +jobid = component.initialize(meshJobFileList, configId) if jobid<0: msg = component.getLastErrorMessage() print "ERR: %s"%msg