// This defines a set of parameters for the job initialization
typedef sequence<MESHJOB::MeshJobFile> MeshJobFileList;
+ // This defines a single parameter for the job initialization
+ struct MeshJobParameter
+ {
+ string name;
+ string value;
+ };
+
+ // This defines a set of parameters for the job initialization
+ typedef sequence<MESHJOB::MeshJobParameter> MeshJobParameterList;
+
// This defines the result data of a job
struct MeshJobResults
{
raises (SALOME::SALOME_Exception);
/*! Initialize a smesh computation job and return the job identifier */
- long initialize(in MESHJOB::MeshJobFileList meshJobFileList, in string configId)
+ long initialize(in MESHJOB::MeshJobFileList meshJobFileList,
+ in MESHJOB::MeshJobParameterList MeshJobParameterList,
+ in string configId)
raises (SALOME::SALOME_Exception);
/*! Submit the job execution and return true if submission is OK */
* <outputMedFile>
*/
const char * MeshJobManager_i::_writeDataFile(std::vector<MESHJOB::MeshJobFile> listConcreteMesh,
- std::vector<MESHJOB::MeshJobFile> listSteelBarMesh) {
+ std::vector<MESHJOB::MeshJobFile> listSteelBarMesh,
+ const MESHJOB::MeshJobParameterList & meshJobParameterList) {
#ifdef WIN32
_mkdir(LOCAL_INPUTDIR.c_str());
#else
dataFile << line.c_str() << std::endl;
}
- // Finally, we conclude with the name of the output file
+ // We conclude the list of files with the name of the output file
line = OUTPUTFILE;
dataFile << line.c_str() << std::endl;
+
+ // We put the numerical parameters at the end of the data file
+ for(CORBA::ULong i=0; i<meshJobParameterList.length(); i++) {
+ MESHJOB::MeshJobParameter param = meshJobParameterList[i];
+ line = std::string(param.name) + " " + std::string(param.value);
+ dataFile << line.c_str() << std::endl;
+ }
+
dataFile.close();
return dataFilename->c_str();
}
/*! Initialize a smesh computation job and return the job identifier */
CORBA::Long MeshJobManager_i::initialize(const MESHJOB::MeshJobFileList & meshJobFileList,
+ const MESHJOB::MeshJobParameterList & meshJobParameterList,
const char * configId)
{
beginService("MeshJobManager_i::initialize");
// data is a text file containing the list of file names and group
// names.
//
- const char * dataFilename = this->_writeDataFile(listConcreteMesh, listSteelBarMesh);
+ const char * dataFilename = this->_writeDataFile(listConcreteMesh, listSteelBarMesh, meshJobParameterList);
LOG("dataFilename = " << dataFilename);
const char * scriptFilename = this->_writeScriptFile(dataFilename, configId);
LOG("scriptFilename = " << scriptFilename);
bool configure (const char *configId,
const MESHJOB::ConfigParameter & configParameter);
CORBA::Long initialize (const MESHJOB::MeshJobFileList & meshJobFileList,
+ const MESHJOB::MeshJobParameterList & meshJobParameterList,
const char *configId);
bool start (CORBA::Long jobId);
char* getState (CORBA::Long jobId);
std::map<long, MESHJOB::MeshJobPaths*> _jobPathsMap;
const char* _writeDataFile (std::vector<MESHJOB::MeshJobFile> listConcreteMesh,
- std::vector<MESHJOB::MeshJobFile> listSteelBarMesh);
+ std::vector<MESHJOB::MeshJobFile> listSteelBarMesh,
+ const MESHJOB::MeshJobParameterList & meshJobParameterList);
const char* _writeScriptFile (const char * dataFileName, const char * configId);
std::vector<std::string> * _getResourceNames();
#meshJobFileList = test02_parameters()
meshJobFileList = test03_parameters()
+meshJobParameterList = []
+param = MESHJOB.MeshJobParameter(name="RminRmax",value="1.5")
+meshJobParameterList.append(param)
+param = MESHJOB.MeshJobParameter(name="NbIteration",value="3")
+meshJobParameterList.append(param)
+
#
# Prepare, start and follow-up the job
#
-jobid = component.initialize(meshJobFileList, configId)
+jobid = component.initialize(meshJobFileList, meshJobParameterList, configId)
if jobid<0:
msg = component.getLastErrorMessage()
print "ERR: %s"%msg