1 // Copyright (C) 2009-2014 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #ifndef _BL_CREATEJOBWIZARD_HXX_
21 #define _BL_CREATEJOBWIZARD_HXX_
25 #include "BL_Traces.hxx"
26 #include "BL_SALOMEServices.hxx"
27 #include "JM_ResourceCatalog.hxx"
33 class ResourceRequirementsWizardPage;
34 class FilesWizardPage;
41 class BatchParametersPage;
42 class CreateJobWizard: public QWizard
47 CreateJobWizard(BL::JobsManager_QT * jobs_manager, BL::SALOMEServices * salome_services);
48 virtual ~CreateJobWizard();
50 void setFilesList(QListWidget * input_files_list, QListWidget * output_files_list);
52 void clone(const std::string & name);
58 BL::JobsManager_QT * _jobs_manager;
59 QListWidget * _input_files_list;
60 QListWidget * _output_files_list;
62 BL::JobNamePage * _job_name_page;
63 BL::BatchParametersPage * _batch_parameters_page;
64 BL::SALOMEServices * _salome_services;
70 std::string yacs_file;
72 std::string python_salome_file;
76 std::string batch_directory;
79 std::string coorm_batch_directory;
81 std::string maximum_duration;
82 unsigned long mem_limit;
83 BL::Job::MemReqType mem_req_type;
87 // Parameters for COORM
88 std::string launcher_file;
89 std::string launcher_args;
91 std::string result_directory;
92 std::list<std::string> input_files_list;
93 std::list<std::string> output_files_list;
95 std::string resource_choosed;
96 std::string batch_queue;
100 std::string ll_jobtype;
105 Page_Command_Main_Definitions,
106 Page_PythonSalome_Main_Definitions,
107 Page_BatchParameters,
108 Page_COORM_BatchParameters,
114 class JobNamePage: public QWizardPage
119 JobNamePage(QWidget * parent, BL::JobsManager_QT * jobs_manager);
120 virtual ~JobNamePage();
122 virtual bool validatePage();
123 virtual int nextId() const ;
124 virtual void cleanupPage() {}
127 void yacs_schema_button(bool checked);
128 void command_button(bool checked);
129 void python_salome_button(bool checked);
132 BL::JobsManager_QT * _jobs_manager;
133 QLabel * _explanation;
136 QRadioButton * _yacs_schema_button;
137 QRadioButton * _command_button;
138 QRadioButton * _python_salome_button;
142 class ConclusionPage: public QWizardPage
145 ConclusionPage(QWidget * parent);
146 virtual ~ConclusionPage();
148 virtual bool validatePage();
149 virtual int nextId() const ;
150 virtual void cleanupPage() {}
153 class BatchParametersPage: public QWizardPage
158 enum MemUnit {MB, GB};
160 BatchParametersPage(QWidget * parent, BL::SALOMEServices * salome_services);
161 virtual ~BatchParametersPage();
163 virtual void initializePage();
164 virtual int nextId() const;
165 virtual void cleanupPage();
167 MemUnit getMemUnit() const;
168 void setMemUnit(MemUnit mem_unit);
170 BL::Job::MemReqType getMemReqType() const;
171 void setMemReqType(BL::Job::MemReqType mem_req_type);
174 Ui::ResourceRequirementsWizardPage * ui;
175 BL::SALOMEServices * _salome_services;
176 std::string resource_choosed;
180 class COORM_BatchParametersPage: public QWizardPage
185 COORM_BatchParametersPage(QWidget * parent, BL::SALOMEServices * salome_services);
186 virtual ~COORM_BatchParametersPage();
188 virtual bool validatePage();
189 virtual int nextId() const;
190 virtual void cleanupPage();
191 virtual void initializePage();
194 void choose_launcher_file();
197 BL::SALOMEServices * _salome_services;
198 QLineEdit * _launcher_file_text;
199 QString resource_choosed;
202 class FilesPage: public QWizardPage
207 FilesPage(BL::CreateJobWizard * parent, BL::SALOMEServices * salome_services);
208 virtual ~FilesPage();
210 virtual void initializePage();
211 virtual int nextId() const;
212 virtual bool isComplete() const;
213 virtual void cleanupPage() {}
216 void choose_input_files();
217 void remove_input_files();
218 void input_itemSelectionChanged();
219 void choose_local_directory();
221 void add_output_file();
222 void remove_output_files();
223 void output_itemSelectionChanged();
226 Ui::FilesWizardPage * ui;
227 BL::SALOMEServices * _salome_services;
228 QString resource_choosed;
231 class ResourcePage: public QWizardPage
236 ResourcePage(BL::CreateJobWizard * parent, BL::SALOMEServices * salome_services);
237 virtual ~ResourcePage();
239 virtual int nextId() const;
240 virtual bool validatePage();
241 virtual void initializePage();
242 virtual void cleanupPage() {}
245 void itemSelected(QListWidgetItem * item);
248 JM::ResourceCatalog * _resource_list;
249 QLineEdit * _resource_choosed;
250 BL::SALOMEServices * _salome_services;
253 QLineEdit * _ll_value;
254 QGridLayout * _main_layout;
257 class YACSSchemaPage: public QWizardPage
262 YACSSchemaPage(QWidget * parent);
263 virtual ~YACSSchemaPage();
265 virtual bool validatePage();
266 virtual int nextId() const ;
267 virtual void cleanupPage() {}
271 void choose_env_file();
274 QLineEdit * _yacs_file_text;
275 QLineEdit * _line_env_file;
278 class CommandMainPage: public QWizardPage
283 CommandMainPage(QWidget * parent);
284 virtual ~CommandMainPage();
286 virtual bool validatePage();
287 virtual int nextId() const ;
288 virtual void cleanupPage() {}
291 void choose_command_file();
292 void choose_env_file();
295 QLineEdit * _line_command;
296 QLineEdit * _line_env_file;
299 class PythonSalomeMainPage: public QWizardPage
304 PythonSalomeMainPage(QWidget * parent);
305 virtual ~PythonSalomeMainPage();
307 virtual bool validatePage();
308 virtual int nextId() const ;
309 virtual void cleanupPage() {}
312 void choose_PythonSalome_file();
313 void choose_env_file();
316 QLineEdit * _line_PythonSalome;
317 QLineEdit * _line_env_file;