]> SALOME platform Git repositories - modules/jobmanager.git/commitdiff
Salome HOME
Add new wizard page "Advanced Parameters" with new parameter wckey
authorRenaud Barate <renaud.barate@edf.fr>
Mon, 6 Oct 2014 16:04:45 +0000 (18:04 +0200)
committerRenaud Barate <renaud.barate@edf.fr>
Mon, 6 Oct 2014 16:04:45 +0000 (18:04 +0200)
src/engine/BL_Job.cxx
src/engine/BL_Job.hxx
src/engine/BL_SALOMEServices.cxx
src/genericgui/AdvancedParametersWizardPage.ui [new file with mode: 0644]
src/genericgui/BL_CreateJobWizard.cxx
src/genericgui/BL_CreateJobWizard.hxx
src/genericgui/BL_JobsManager_QT.cxx
src/genericgui/CMakeLists.txt

index 487a39b34b494323ef389e7676cd7e7e921ab482..6f7886b9b530e2b1301546bcd3c2a2d65d826cd9 100644 (file)
@@ -203,6 +203,18 @@ BL::Job::getBatchQueue()
   return _batch_queue;
 }
 
+void
+BL::Job::setWCKey(const std::string & wckey)
+{
+  _wckey = wckey;
+}
+
+const std::string &
+BL::Job::getWCKey()
+{
+  return _wckey;
+}
+
 void
 BL::Job::setLoadLevelerJobType(const std::string & jobtype)
 {
index 0a26e8cb6648a1bdf3a40a5551256bcd70c5f821..510ee1c1c3555c23f2985fc029df1b65ed8d42aa 100644 (file)
@@ -89,6 +89,9 @@ namespace BL{
       void setBatchQueue(const std::string & queue);
       std::string & getBatchQueue();
 
+      void setWCKey(const std::string & wckey);
+      const std::string & getWCKey();
+
       void setLoadLevelerJobType(const std::string & jobtype);
       std::string & getLoadLevelerJobType();
 
@@ -119,6 +122,7 @@ namespace BL{
       BL::Job::FilesParam _files_params;
       std::string _resource_choosed;
       std::string _batch_queue;
+      std::string _wckey;
       std::string _ll_jobtype;
 
       int _salome_launcher_id;
index 30f6362c6aef4ca182bc27bd762a6c9d9696c8b4..c5c1129309b4ad1cb2e3602dd5778e84a779e398 100644 (file)
@@ -321,6 +321,7 @@ BL::SALOMEServices::create_job(BL::Job * job)
   job_parameters->resource_required.nb_proc = cpp_batch_params.nb_proc;
   job_parameters->queue = CORBA::string_dup(job->getBatchQueue().c_str());
   job_parameters->exclusive = cpp_batch_params.exclusive;
+  job_parameters->wckey = CORBA::string_dup(job->getWCKey().c_str());
 
   // Memory
   switch (cpp_batch_params.mem_req_type)
@@ -621,6 +622,7 @@ BL::SALOMEServices::get_new_job(int job_number)
     job_return->setJobFile(job_parameters->job_file.in());
     job_return->setEnvFile(job_parameters->env_file.in());
     job_return->setBatchQueue(job_parameters->queue.in());
+    job_return->setWCKey(job_parameters->wckey.in());
 
     BL::Job::FilesParam param;
     param.result_directory = job_parameters->result_directory.in();
diff --git a/src/genericgui/AdvancedParametersWizardPage.ui b/src/genericgui/AdvancedParametersWizardPage.ui
new file mode 100644 (file)
index 0000000..ca09411
--- /dev/null
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>AdvancedParametersWizardPage</class>
+ <widget class="QWizardPage" name="AdvancedParametersWizardPage">
+  <property name="title">
+   <string>Advanced Parameters</string>
+  </property>
+  <layout class="QFormLayout" name="formLayout">
+   <item row="0" column="0">
+    <widget class="QLabel" name="label">
+     <property name="text">
+      <string>Workload Characterization Key (wckey):</string>
+     </property>
+    </widget>
+   </item>
+   <item row="0" column="1">
+    <widget class="QLineEdit" name="line_wckey"/>
+   </item>
+  </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
index 6ff0fe2dd004ccb47cd50992e347fb98c739bfee..2fe128e23672d00a9709e2e8ab12547cfdf7a10c 100644 (file)
@@ -29,6 +29,7 @@
 
 #include <ui_ResourceRequirementsWizardPage.h>
 #include <ui_FilesWizardPage.h>
+#include <ui_AdvancedParametersWizardPage.h>
 
 #ifdef WNT
 #undef ERROR
@@ -87,6 +88,7 @@ BL::CreateJobWizard::CreateJobWizard(BL::JobsManager_QT * jobs_manager, BL::SALO
 
   setPage(Page_Files, new BL::FilesPage(this, salome_services));
   setPage(Page_Resource, new BL::ResourcePage(this, salome_services));
+  setPage(Page_Advanced, new BL::AdvancedParametersPage(this));
   setPage(Page_Conclusion, new BL::ConclusionPage(this));
 
   // Specific pages
@@ -214,6 +216,7 @@ BL::CreateJobWizard::clone(const std::string & name)
     setField("resource_choosed", QString(job->getResource().c_str()));
     setField("batch_queue", QString(job->getBatchQueue().c_str()));
     setField("ll_jobtype", QString(job->getLoadLevelerJobType().c_str()));
+    setField("wckey", QString(job->getWCKey().c_str()));
   }
 }
 
@@ -344,6 +347,10 @@ BL::CreateJobWizard::end(int result)
       ll_jobtype = "";
     }
 
+    // WC Key
+    QString f_wckey = field("wckey").toString();
+    wckey = f_wckey.trimmed().toUtf8().constData();
+
     start_job = field("start_job").toBool();
   }
 }
@@ -1041,7 +1048,7 @@ FilesPage::output_itemSelectionChanged()
 int 
 FilesPage::nextId() const
 {
-  return BL::CreateJobWizard::Page_Conclusion;
+  return BL::CreateJobWizard::Page_Advanced;
 }
 
 BL::ConclusionPage::ConclusionPage(QWidget * parent)
@@ -1281,3 +1288,24 @@ BL::PythonSalomeMainPage::nextId() const
 {
   return BL::CreateJobWizard::Page_Resource;
 }
+
+
+
+AdvancedParametersPage::AdvancedParametersPage(CreateJobWizard * parent)
+: QWizardPage(parent),
+  ui(new Ui::AdvancedParametersWizardPage)
+{
+  ui->setupUi(this);
+  registerField("wckey", ui->line_wckey);
+};
+
+AdvancedParametersPage::~AdvancedParametersPage()
+{
+  delete ui;
+}
+
+int
+AdvancedParametersPage::nextId() const
+{
+  return BL::CreateJobWizard::Page_Conclusion;
+}
index 28f1585eb4136b1c8741399e5abda9e88c76eab6..d5c004aa0a7c3c1ca28489985d47abc8e2fe128d 100644 (file)
@@ -32,6 +32,7 @@
 namespace Ui {
   class ResourceRequirementsWizardPage;
   class FilesWizardPage;
+  class AdvancedParametersWizardPage;
 }
 
 namespace BL{
@@ -94,6 +95,7 @@ namespace BL{
 
       std::string resource_choosed;
       std::string batch_queue;
+      std::string wckey;
 
       bool start_job;
       int dump_yacs_state;
@@ -108,6 +110,7 @@ namespace BL{
             Page_COORM_BatchParameters,
             Page_Files,
             Page_Resource,
+            Page_Advanced,
             Page_Conclusion};
   };
 
@@ -316,6 +319,23 @@ namespace BL{
       QLineEdit * _line_PythonSalome;
       QLineEdit * _line_env_file;
   };
+
+  class AdvancedParametersPage: public QWizardPage
+  {
+    Q_OBJECT
+
+    public:
+      AdvancedParametersPage(BL::CreateJobWizard * parent);
+      virtual ~AdvancedParametersPage();
+
+      virtual int nextId() const;
+      virtual void cleanupPage() {}
+
+    private:
+      Ui::AdvancedParametersWizardPage * ui;
+
+  };
+
 }
 
 #endif
index 47171ed0ff09dd90252d7ec11842cf56b9c38777..8369dc74af18f7472c7076013a261d291b5e850c 100644 (file)
@@ -325,6 +325,7 @@ BL::JobsManager_QT::create_job_with_wizard(BL::CreateJobWizard & wizard)
   new_job->setResource(wizard.resource_choosed);
   new_job->setBatchQueue(wizard.batch_queue);
   new_job->setLoadLevelerJobType(wizard.ll_jobtype);
+  new_job->setWCKey(wizard.wckey);
 
   // End
   addJobToLauncher(wizard.job_name);
index 3cfc8caf4bd9cd46edd8b3cb15024892c665bd73..5abfb515568dba7569150d42900bb30c39d92290 100644 (file)
@@ -88,6 +88,7 @@ SET(_other_SOURCES
 SET(_uic_files
   ResourceRequirementsWizardPage.ui
   FilesWizardPage.ui
+  AdvancedParametersWizardPage.ui
 )
 
 # header files / uic wrappings