1 // Copyright (C) 2009-2015 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_
23 #include "BL_Traces.hxx"
24 #include "BL_SALOMEServices.hxx"
25 #include "JM_ResourceCatalog.hxx"
28 #include <QWizardPage>
38 class ResourceRequirementsWizardPage;
39 class FilesWizardPage;
40 class AdvancedParametersWizardPage;
47 class BatchParametersPage;
48 class CreateJobWizard: public QWizard
53 CreateJobWizard(BL::JobsManager_QT * jobs_manager, BL::SALOMEServices * salome_services);
54 virtual ~CreateJobWizard();
56 void setFilesList(QListWidget * input_files_list, QListWidget * output_files_list);
58 void clone(const std::string & name);
64 BL::JobsManager_QT * _jobs_manager;
65 QListWidget * _input_files_list;
66 QListWidget * _output_files_list;
68 BL::JobNamePage * _job_name_page;
69 BL::BatchParametersPage * _batch_parameters_page;
70 BL::SALOMEServices * _salome_services;
75 enum {YACS, COMMAND, PYTHON_SALOME} job_type;
77 std::string yacs_file;
79 std::string python_salome_file;
83 std::string batch_directory;
86 std::string coorm_batch_directory;
88 std::string maximum_duration;
90 BL::Job::MemReqType mem_req_type;
94 // Parameters for COORM
95 std::string launcher_file;
96 std::string launcher_args;
98 std::string result_directory;
99 std::list<std::string> input_files_list;
100 std::list<std::string> output_files_list;
102 std::string resource_choosed;
103 std::string batch_queue;
105 std::string extra_params;
109 std::string ll_jobtype;
110 std::string yacs_driver_options;
115 Page_Command_Main_Definitions,
116 Page_PythonSalome_Main_Definitions,
117 Page_BatchParameters,
118 Page_COORM_BatchParameters,
125 class JobNamePage: public QWizardPage
130 JobNamePage(QWidget * parent, BL::JobsManager_QT * jobs_manager);
131 virtual ~JobNamePage();
133 virtual bool validatePage();
134 virtual int nextId() const ;
135 virtual void cleanupPage() {}
138 void yacs_schema_button(bool checked);
139 void command_button(bool checked);
140 void python_salome_button(bool checked);
143 BL::JobsManager_QT * _jobs_manager;
144 QLabel * _explanation;
150 class ConclusionPage: public QWizardPage
153 ConclusionPage(QWidget * parent);
154 virtual ~ConclusionPage();
156 virtual bool validatePage();
157 virtual int nextId() const ;
158 virtual void cleanupPage() {}
161 class BatchParametersPage: public QWizardPage
166 enum MemUnit {MB, GB};
168 BatchParametersPage(QWidget * parent, BL::SALOMEServices * salome_services);
169 virtual ~BatchParametersPage();
171 virtual void initializePage();
172 virtual int nextId() const;
173 virtual void cleanupPage();
175 MemUnit getMemUnit() const;
176 void setMemUnit(MemUnit mem_unit);
178 BL::Job::MemReqType getMemReqType() const;
179 void setMemReqType(BL::Job::MemReqType mem_req_type);
186 Ui::ResourceRequirementsWizardPage * ui;
187 BL::SALOMEServices * _salome_services;
188 std::string resource_choosed;
192 class COORM_BatchParametersPage: public QWizardPage
197 COORM_BatchParametersPage(QWidget * parent, BL::SALOMEServices * salome_services);
198 virtual ~COORM_BatchParametersPage();
200 virtual bool validatePage();
201 virtual int nextId() const;
202 virtual void cleanupPage();
203 virtual void initializePage();
206 void choose_launcher_file();
209 BL::SALOMEServices * _salome_services;
210 QLineEdit * _launcher_file_text;
211 QString resource_choosed;
214 class FilesPage: public QWizardPage
219 FilesPage(BL::CreateJobWizard * parent, BL::SALOMEServices * salome_services);
220 virtual ~FilesPage();
222 virtual void initializePage();
223 virtual int nextId() const;
224 virtual bool isComplete() const;
225 virtual void cleanupPage() {}
228 void choose_input_files();
229 void remove_input_files();
230 void input_itemSelectionChanged();
231 void choose_local_directory();
233 void add_output_file();
234 void remove_output_files();
235 void output_itemSelectionChanged();
238 Ui::FilesWizardPage * ui;
239 BL::SALOMEServices * _salome_services;
240 QString resource_choosed;
243 class ResourcePage: public QWizardPage
248 ResourcePage(BL::CreateJobWizard * parent, BL::SALOMEServices * salome_services);
249 virtual ~ResourcePage();
251 virtual int nextId() const;
252 virtual bool validatePage();
253 virtual void initializePage();
254 virtual void cleanupPage() {}
257 void itemSelected(QListWidgetItem * item);
260 JM::ResourceCatalog * _resource_list;
261 QLineEdit * _resource_choosed;
262 BL::SALOMEServices * _salome_services;
265 QLineEdit * _ll_value;
266 QGridLayout * _main_layout;
269 class YACSSchemaPage: public QWizardPage
274 YACSSchemaPage(QWidget * parent);
275 virtual ~YACSSchemaPage();
277 virtual bool validatePage();
278 virtual int nextId() const ;
279 virtual void cleanupPage() {}
283 void choose_env_file();
286 QLineEdit * _yacs_file_text;
287 QLineEdit * _line_env_file;
290 class CommandMainPage: public QWizardPage
295 CommandMainPage(QWidget * parent);
296 virtual ~CommandMainPage();
298 virtual bool validatePage();
299 virtual int nextId() const ;
300 virtual void cleanupPage() {}
303 void choose_command_file();
304 void choose_env_file();
307 QLineEdit * _line_command;
308 QLineEdit * _line_env_file;
311 class PythonSalomeMainPage: public QWizardPage
316 PythonSalomeMainPage(QWidget * parent);
317 virtual ~PythonSalomeMainPage();
319 virtual bool validatePage();
320 virtual int nextId() const ;
321 virtual void cleanupPage() {}
324 void choose_PythonSalome_file();
325 void choose_env_file();
328 QLineEdit * _line_PythonSalome;
329 QLineEdit * _line_env_file;
332 class AdvancedParametersPage: public QWizardPage
337 AdvancedParametersPage(BL::CreateJobWizard * parent);
338 virtual ~AdvancedParametersPage();
340 virtual int nextId() const;
341 virtual void cleanupPage() {}
344 Ui::AdvancedParametersWizardPage * ui;