Salome HOME
New access protocol rsync.
[modules/yacs.git] / src / Launcher / Launcher_Job_YACSFile.cxx
index aefb5cb3e7fb706bfb0e2192158b71119bf2a5b6..79e5b9a3f1a146a7437d9947f5708b7e9e6511ea 100644 (file)
@@ -1,9 +1,9 @@
-// Copyright (C) 2009-2013  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2009-2016  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library 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 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
 //
 // This library is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
 #include "Launcher_Job_YACSFile.hxx"
 #include <sstream>
 
+const char Launcher::Job_YACSFile::TYPE_NAME[] = "yacs_file";
 
-Launcher::Job_YACSFile::Job_YACSFile() 
+Launcher::Job_YACSFile::Job_YACSFile()
 {
-  _job_type = "yacs_file";
+  _job_type = Launcher::Job_YACSFile::TYPE_NAME;
   _dumpState = -1;
+  _yacsDriverOptions = "";
 }
 
 Launcher::Job_YACSFile::~Job_YACSFile() {}
 
-void 
+void
 Launcher::Job_YACSFile::setJobFile(const std::string & job_file)
 {
   Launcher::Job::setJobFile(job_file);
@@ -40,9 +42,11 @@ Launcher::Job_YACSFile::setJobFile(const std::string & job_file)
 void
 Launcher::Job_YACSFile::addJobTypeSpecificScript(std::ofstream & launch_script_stream)
 {
-  launch_script_stream << _resource_definition.AppliPath << "/runSession -p $appli_port driver -k $appli_port " << _job_file_name_complete;
+  launch_script_stream << _resource_definition.AppliPath << "/salome shell -p \"$appli_port\" -- driver -k\"$appli_port\" " << _job_file_name_complete;
   if (_dumpState > 0)
     launch_script_stream << " --dump=" << _dumpState;
+  if(! _yacsDriverOptions.empty())
+    launch_script_stream << " " << _yacsDriverOptions ;
   launch_script_stream << " > logs/yacs_" << _launch_date << ".log 2>&1" << std::endl;
 }
 
@@ -59,4 +63,11 @@ Launcher::Job_YACSFile::checkSpecificParameters()
     if (!(iss >> _dumpState))
       throw LauncherException("Specific parameter EnableDumpYACS is not correctly defined: it should be an integer. Value given is " + user_value);
   }
+  
+  it = _specific_parameters.find("YACSDriverOptions");
+  if (it != _specific_parameters.end())
+  {
+    // Decode info
+    _yacsDriverOptions = it->second;
+  }
 }