Salome HOME
padder: rename MeshJobParameter to MeshJobFile
authoruhz <ulysse.humbert-gonzalez@opencascade.com>
Tue, 7 Mar 2017 10:59:31 +0000 (11:59 +0100)
committeruhz <ulysse.humbert-gonzalez@opencascade.com>
Tue, 7 Mar 2017 10:59:31 +0000 (11:59 +0100)
src/Tools/padder/meshjob/idl/CMakeLists.txt [changed mode: 0755->0644]
src/Tools/padder/meshjob/idl/MESHJOB.idl
src/Tools/padder/meshjob/impl/MeshJobManager_i.cxx
src/Tools/padder/meshjob/impl/MeshJobManager_i.hxx
src/Tools/padder/spadderpy/__init__.py
src/Tools/padder/spadderpy/gui/inputdata.py
src/Tools/padder/spadderpy/gui/plugindialog.py
src/Tools/padder/unittests/usecase_meshJobManager.py

old mode 100755 (executable)
new mode 100644 (file)
index 3179daff36b51e72a801a854cdb0b55a86a76915..e37a3678181f2eca226f437f25e281a45069e97b 100644 (file)
@@ -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<MESHJOB::MeshJobParameter> MeshJobParameterList;
+  typedef sequence<MESHJOB::MeshJobFile> 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 */
index 35f162be9ff29cfa4bfe38c69213f11469d60260..17d1c0fb0b26d3548ea2497850c28af568bac533 100644 (file)
@@ -167,8 +167,8 @@ static std::string REMOTE_WORKDIR("/tmp/spadder.remote.workdir."+USER);
  * <steelBarMeshFile_N>   <steelBarGroupName_N>
  * <outputMedFile>
  */
-const char * MeshJobManager_i::_writeDataFile(std::vector<MESHJOB::MeshJobParameter> listConcreteMesh,
-                                              std::vector<MESHJOB::MeshJobParameter> listSteelBarMesh) {
+const char * MeshJobManager_i::_writeDataFile(std::vector<MESHJOB::MeshJobFile> listConcreteMesh,
+                                              std::vector<MESHJOB::MeshJobFile> 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<MESHJOB::MeshJobParameter> listConcreteMesh;
-  std::vector<MESHJOB::MeshJobParameter> listSteelBarMesh;
-  for(CORBA::ULong i=0; i<meshJobParameterList.length(); i++) {
-    MESHJOB::MeshJobParameter currentMesh = meshJobParameterList[i];
+  std::vector<MESHJOB::MeshJobFile> listConcreteMesh;
+  std::vector<MESHJOB::MeshJobFile> listSteelBarMesh;
+  for(CORBA::ULong i=0; i<meshJobFileList.length(); i++) {
+    MESHJOB::MeshJobFile currentMesh = meshJobFileList[i];
     switch ( currentMesh.file_type ) {
     case MESHJOB::MED_CONCRETE:
       listConcreteMesh.push_back(currentMesh);
index 7b2952d8459af05c6c2ff68ad6cdc9d61f46f587..176d32f0c33d62219d4735bea7f41323843399d2 100644 (file)
@@ -55,7 +55,7 @@ public:
 
   bool           configure  (const char *configId,
                              const MESHJOB::ConfigParameter & configParameter);
-  CORBA::Long    initialize (const MESHJOB::MeshJobParameterList & meshJobParameterList,
+  CORBA::Long    initialize (const MESHJOB::MeshJobFileList & meshJobFileList,
                              const char *configId);
   bool           start      (CORBA::Long jobId);
   char*          getState   (CORBA::Long jobId);
@@ -83,8 +83,8 @@ private:
   std::map<long, long> _jobDateTimeMap;
   std::map<long, MESHJOB::MeshJobPaths*> _jobPathsMap;
 
-  const char* _writeDataFile   (std::vector<MESHJOB::MeshJobParameter> listConcreteMesh,
-                                std::vector<MESHJOB::MeshJobParameter> listSteelBarMesh);
+  const char* _writeDataFile   (std::vector<MESHJOB::MeshJobFile> listConcreteMesh,
+                                std::vector<MESHJOB::MeshJobFile> listSteelBarMesh);
   const char* _writeScriptFile (const char * dataFileName, const char * configId);
 
   std::vector<std::string> * _getResourceNames();
index 004256778103fe78b8e22284a0d05eaba9b23bfb..0031b907da0ef0eceaec8e87daeae25fc4ba45c0 100644 (file)
@@ -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():
index 2490af95559a0f77fe03e36bee1abc34ca2aba7b..6633fb60cbea7b2cf970ae77191c1af0762d8353 100644 (file)
@@ -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([
index cb26164ab897f372721a59ef5f9a0e6c87b665b6..bb5c76abb85d70f342b5e7ac03f2ca602765de27 100644 (file)
@@ -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())
index 8085105bd452a7faa72bc1fd02a2d9c49e04d02b..127f321196eecfbace3176b1362a611ef41761cf 100644 (file)
@@ -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