Salome HOME
Merge relevant changes from V8_0_0_BR branch
[modules/jobmanager.git] / src / genericgui / BL_CreateJobWizard.hxx
index 71d2ec78c7b051c7ff429a63dbdc9d580b3b9199..624577318f2f56fd79f86449d86fa70bab49936c 100644 (file)
@@ -1,9 +1,9 @@
-// Copyright (C) 2009-2012  CEA/DEN, EDF R&D
+// Copyright (C) 2009-2015  CEA/DEN, EDF R&D
 //
 // 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
 #ifndef _BL_CREATEJOBWIZARD_HXX_
 #define _BL_CREATEJOBWIZARD_HXX_
 
-#include <QtGui>
-
 #include "BL_Traces.hxx"
 #include "BL_SALOMEServices.hxx"
 #include "JM_ResourceCatalog.hxx"
 
+#include <QWizard>
+#include <QWizardPage>
 #include <string>
 #include <list>
 
-namespace BL{
+class QGridLayout;
+class QLabel;
+class QLineEdit;
+class QListWidget;
+
+namespace Ui {
+  class ResourceRequirementsWizardPage;
+  class FilesWizardPage;
+  class AdvancedParametersWizardPage;
+}
+
+namespace BL {
 
   class JobsManager_QT;
   class JobNamePage;
+  class BatchParametersPage;
   class CreateJobWizard: public QWizard
   {
     Q_OBJECT
@@ -49,18 +61,18 @@ namespace BL{
       void end(int result);
 
     private:
-      //Page Name
-      QLineEdit * _nameLineEdit;
       BL::JobsManager_QT * _jobs_manager;
       QListWidget * _input_files_list;
       QListWidget * _output_files_list;
 
       BL::JobNamePage * _job_name_page;
+      BL::BatchParametersPage * _batch_parameters_page;
       BL::SALOMEServices * _salome_services;
 
     public:
       // Results
       std::string job_name;
+      enum {YACS, COMMAND, PYTHON_SALOME} job_type;
 
       std::string yacs_file;
       std::string command;
@@ -69,9 +81,19 @@ namespace BL{
       std::string env_file;
 
       std::string batch_directory;
+
+      // For COORM
+      std::string coorm_batch_directory;
+
       std::string maximum_duration;
-      std::string expected_memory;
+      long mem_limit;
+      BL::Job::MemReqType mem_req_type;
       int nb_proc;
+      bool exclusive;
+
+      // Parameters for COORM
+      std::string launcher_file;
+      std::string launcher_args;
 
       std::string result_directory;
       std::list<std::string> input_files_list;
@@ -79,6 +101,8 @@ namespace BL{
 
       std::string resource_choosed;
       std::string batch_queue;
+      std::string wckey;
+      std::string extra_params;
 
       bool start_job;
       int dump_yacs_state;
@@ -90,8 +114,10 @@ namespace BL{
             Page_Command_Main_Definitions,
             Page_PythonSalome_Main_Definitions,
             Page_BatchParameters,
+            Page_COORM_BatchParameters,
             Page_Files,
             Page_Resource,
+            Page_Advanced,
             Page_Conclusion};
   };
 
@@ -117,9 +143,6 @@ namespace BL{
       QLabel * _explanation;
 
     public:
-      QRadioButton * _yacs_schema_button;
-      QRadioButton * _command_button;
-      QRadioButton * _python_salome_button;
       bool _check_name;
   };
 
@@ -139,16 +162,51 @@ namespace BL{
     Q_OBJECT
 
     public:
+      enum MemUnit {MB, GB};
+
       BatchParametersPage(QWidget * parent, BL::SALOMEServices * salome_services);
       virtual ~BatchParametersPage();
 
+      virtual void initializePage();
+      virtual int nextId() const;
+      virtual void cleanupPage();
+
+      MemUnit getMemUnit() const;
+      void setMemUnit(MemUnit mem_unit);
+
+      BL::Job::MemReqType getMemReqType() const;
+      void setMemReqType(BL::Job::MemReqType mem_req_type);
+
+    public slots:
+      void timeChanged();
+      void memChanged();
+
+    private:
+      Ui::ResourceRequirementsWizardPage * ui;
+      BL::SALOMEServices * _salome_services;
+      std::string resource_choosed;
+  };
+
+  // For COORM
+  class COORM_BatchParametersPage: public QWizardPage
+  {
+    Q_OBJECT
+
+    public:
+      COORM_BatchParametersPage(QWidget * parent, BL::SALOMEServices * salome_services);
+      virtual ~COORM_BatchParametersPage();
+
       virtual bool validatePage();
       virtual int nextId() const;
       virtual void cleanupPage();
       virtual void initializePage();
 
+    public slots:
+      void choose_launcher_file();
+
     private:
       BL::SALOMEServices * _salome_services;
+      QLineEdit * _launcher_file_text;
       QString resource_choosed;
   };
 
@@ -157,11 +215,12 @@ namespace BL{
     Q_OBJECT
 
     public:
-      FilesPage(BL::CreateJobWizard * parent);
+      FilesPage(BL::CreateJobWizard * parent, BL::SALOMEServices * salome_services);
       virtual ~FilesPage();
 
+      virtual void initializePage();
       virtual int nextId() const;
-      virtual bool validatePage();
+      virtual bool isComplete() const;
       virtual void cleanupPage() {}
 
     public slots:
@@ -175,14 +234,9 @@ namespace BL{
       void output_itemSelectionChanged();
 
     private:
-      QPushButton * _input_files_button;
-      QPushButton * _remove_input_files_button;
-      QListWidget * _input_files_list;
-      QLineEdit * _result_directory;
-
-      QPushButton * _output_files_button;
-      QPushButton * _remove_output_files_button;
-      QListWidget * _output_files_list;
+      Ui::FilesWizardPage * ui;
+      BL::SALOMEServices * _salome_services;
+      QString resource_choosed;
   };
 
   class ResourcePage: public QWizardPage
@@ -273,6 +327,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