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_
25 #include "BL_Traces.hxx"
26 #include "BL_SALOMEServices.hxx"
27 #include "JM_ResourceCatalog.hxx"
33 class ResourceRequirementsWizardPage;
34 class FilesWizardPage;
35 class AdvancedParametersWizardPage;
42 class BatchParametersPage;
43 class CreateJobWizard: public QWizard
48 CreateJobWizard(BL::JobsManager_QT * jobs_manager, BL::SALOMEServices * salome_services);
49 virtual ~CreateJobWizard();
51 void setFilesList(QListWidget * input_files_list, QListWidget * output_files_list);
53 void clone(const std::string & name);
59 BL::JobsManager_QT * _jobs_manager;
60 QListWidget * _input_files_list;
61 QListWidget * _output_files_list;
63 BL::JobNamePage * _job_name_page;
64 BL::BatchParametersPage * _batch_parameters_page;
65 BL::SALOMEServices * _salome_services;
70 enum {YACS, COMMAND, PYTHON_SALOME} job_type;
72 std::string yacs_file;
74 std::string python_salome_file;
78 std::string batch_directory;
81 std::string coorm_batch_directory;
83 std::string maximum_duration;
85 BL::Job::MemReqType mem_req_type;
89 // Parameters for COORM
90 std::string launcher_file;
91 std::string launcher_args;
93 std::string result_directory;
94 std::list<std::string> input_files_list;
95 std::list<std::string> output_files_list;
97 std::string resource_choosed;
98 std::string batch_queue;
100 std::string extra_params;
104 std::string ll_jobtype;
109 Page_Command_Main_Definitions,
110 Page_PythonSalome_Main_Definitions,
111 Page_BatchParameters,
112 Page_COORM_BatchParameters,
119 class JobNamePage: public QWizardPage
124 JobNamePage(QWidget * parent, BL::JobsManager_QT * jobs_manager);
125 virtual ~JobNamePage();
127 virtual bool validatePage();
128 virtual int nextId() const ;
129 virtual void cleanupPage() {}
132 void yacs_schema_button(bool checked);
133 void command_button(bool checked);
134 void python_salome_button(bool checked);
137 BL::JobsManager_QT * _jobs_manager;
138 QLabel * _explanation;
144 class ConclusionPage: public QWizardPage
147 ConclusionPage(QWidget * parent);
148 virtual ~ConclusionPage();
150 virtual bool validatePage();
151 virtual int nextId() const ;
152 virtual void cleanupPage() {}
155 class BatchParametersPage: public QWizardPage
160 enum MemUnit {MB, GB};
162 BatchParametersPage(QWidget * parent, BL::SALOMEServices * salome_services);
163 virtual ~BatchParametersPage();
165 virtual void initializePage();
166 virtual int nextId() const;
167 virtual void cleanupPage();
169 MemUnit getMemUnit() const;
170 void setMemUnit(MemUnit mem_unit);
172 BL::Job::MemReqType getMemReqType() const;
173 void setMemReqType(BL::Job::MemReqType mem_req_type);
180 Ui::ResourceRequirementsWizardPage * ui;
181 BL::SALOMEServices * _salome_services;
182 std::string resource_choosed;
186 class COORM_BatchParametersPage: public QWizardPage
191 COORM_BatchParametersPage(QWidget * parent, BL::SALOMEServices * salome_services);
192 virtual ~COORM_BatchParametersPage();
194 virtual bool validatePage();
195 virtual int nextId() const;
196 virtual void cleanupPage();
197 virtual void initializePage();
200 void choose_launcher_file();
203 BL::SALOMEServices * _salome_services;
204 QLineEdit * _launcher_file_text;
205 QString resource_choosed;
208 class FilesPage: public QWizardPage
213 FilesPage(BL::CreateJobWizard * parent, BL::SALOMEServices * salome_services);
214 virtual ~FilesPage();
216 virtual void initializePage();
217 virtual int nextId() const;
218 virtual bool isComplete() const;
219 virtual void cleanupPage() {}
222 void choose_input_files();
223 void remove_input_files();
224 void input_itemSelectionChanged();
225 void choose_local_directory();
227 void add_output_file();
228 void remove_output_files();
229 void output_itemSelectionChanged();
232 Ui::FilesWizardPage * ui;
233 BL::SALOMEServices * _salome_services;
234 QString resource_choosed;
237 class ResourcePage: public QWizardPage
242 ResourcePage(BL::CreateJobWizard * parent, BL::SALOMEServices * salome_services);
243 virtual ~ResourcePage();
245 virtual int nextId() const;
246 virtual bool validatePage();
247 virtual void initializePage();
248 virtual void cleanupPage() {}
251 void itemSelected(QListWidgetItem * item);
254 JM::ResourceCatalog * _resource_list;
255 QLineEdit * _resource_choosed;
256 BL::SALOMEServices * _salome_services;
259 QLineEdit * _ll_value;
260 QGridLayout * _main_layout;
263 class YACSSchemaPage: public QWizardPage
268 YACSSchemaPage(QWidget * parent);
269 virtual ~YACSSchemaPage();
271 virtual bool validatePage();
272 virtual int nextId() const ;
273 virtual void cleanupPage() {}
277 void choose_env_file();
280 QLineEdit * _yacs_file_text;
281 QLineEdit * _line_env_file;
284 class CommandMainPage: public QWizardPage
289 CommandMainPage(QWidget * parent);
290 virtual ~CommandMainPage();
292 virtual bool validatePage();
293 virtual int nextId() const ;
294 virtual void cleanupPage() {}
297 void choose_command_file();
298 void choose_env_file();
301 QLineEdit * _line_command;
302 QLineEdit * _line_env_file;
305 class PythonSalomeMainPage: public QWizardPage
310 PythonSalomeMainPage(QWidget * parent);
311 virtual ~PythonSalomeMainPage();
313 virtual bool validatePage();
314 virtual int nextId() const ;
315 virtual void cleanupPage() {}
318 void choose_PythonSalome_file();
319 void choose_env_file();
322 QLineEdit * _line_PythonSalome;
323 QLineEdit * _line_env_file;
326 class AdvancedParametersPage: public QWizardPage
331 AdvancedParametersPage(BL::CreateJobWizard * parent);
332 virtual ~AdvancedParametersPage();
334 virtual int nextId() const;
335 virtual void cleanupPage() {}
338 Ui::AdvancedParametersWizardPage * ui;