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;
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;
71 std::string yacs_file;
73 std::string python_salome_file;
77 std::string batch_directory;
80 std::string coorm_batch_directory;
82 std::string maximum_duration;
84 BL::Job::MemReqType mem_req_type;
88 // Parameters for COORM
89 std::string launcher_file;
90 std::string launcher_args;
92 std::string result_directory;
93 std::list<std::string> input_files_list;
94 std::list<std::string> output_files_list;
96 std::string resource_choosed;
97 std::string batch_queue;
99 std::string extra_params;
103 std::string ll_jobtype;
108 Page_Command_Main_Definitions,
109 Page_PythonSalome_Main_Definitions,
110 Page_BatchParameters,
111 Page_COORM_BatchParameters,
118 class JobNamePage: public QWizardPage
123 JobNamePage(QWidget * parent, BL::JobsManager_QT * jobs_manager);
124 virtual ~JobNamePage();
126 virtual bool validatePage();
127 virtual int nextId() const ;
128 virtual void cleanupPage() {}
131 void yacs_schema_button(bool checked);
132 void command_button(bool checked);
133 void python_salome_button(bool checked);
136 BL::JobsManager_QT * _jobs_manager;
137 QLabel * _explanation;
140 QRadioButton * _yacs_schema_button;
141 QRadioButton * _command_button;
142 QRadioButton * _python_salome_button;
146 class ConclusionPage: public QWizardPage
149 ConclusionPage(QWidget * parent);
150 virtual ~ConclusionPage();
152 virtual bool validatePage();
153 virtual int nextId() const ;
154 virtual void cleanupPage() {}
157 class BatchParametersPage: public QWizardPage
162 enum MemUnit {MB, GB};
164 BatchParametersPage(QWidget * parent, BL::SALOMEServices * salome_services);
165 virtual ~BatchParametersPage();
167 virtual void initializePage();
168 virtual int nextId() const;
169 virtual void cleanupPage();
171 MemUnit getMemUnit() const;
172 void setMemUnit(MemUnit mem_unit);
174 BL::Job::MemReqType getMemReqType() const;
175 void setMemReqType(BL::Job::MemReqType mem_req_type);
182 Ui::ResourceRequirementsWizardPage * ui;
183 BL::SALOMEServices * _salome_services;
184 std::string resource_choosed;
188 class COORM_BatchParametersPage: public QWizardPage
193 COORM_BatchParametersPage(QWidget * parent, BL::SALOMEServices * salome_services);
194 virtual ~COORM_BatchParametersPage();
196 virtual bool validatePage();
197 virtual int nextId() const;
198 virtual void cleanupPage();
199 virtual void initializePage();
202 void choose_launcher_file();
205 BL::SALOMEServices * _salome_services;
206 QLineEdit * _launcher_file_text;
207 QString resource_choosed;
210 class FilesPage: public QWizardPage
215 FilesPage(BL::CreateJobWizard * parent, BL::SALOMEServices * salome_services);
216 virtual ~FilesPage();
218 virtual void initializePage();
219 virtual int nextId() const;
220 virtual bool isComplete() const;
221 virtual void cleanupPage() {}
224 void choose_input_files();
225 void remove_input_files();
226 void input_itemSelectionChanged();
227 void choose_local_directory();
229 void add_output_file();
230 void remove_output_files();
231 void output_itemSelectionChanged();
234 Ui::FilesWizardPage * ui;
235 BL::SALOMEServices * _salome_services;
236 QString resource_choosed;
239 class ResourcePage: public QWizardPage
244 ResourcePage(BL::CreateJobWizard * parent, BL::SALOMEServices * salome_services);
245 virtual ~ResourcePage();
247 virtual int nextId() const;
248 virtual bool validatePage();
249 virtual void initializePage();
250 virtual void cleanupPage() {}
253 void itemSelected(QListWidgetItem * item);
256 JM::ResourceCatalog * _resource_list;
257 QLineEdit * _resource_choosed;
258 BL::SALOMEServices * _salome_services;
261 QLineEdit * _ll_value;
262 QGridLayout * _main_layout;
265 class YACSSchemaPage: public QWizardPage
270 YACSSchemaPage(QWidget * parent);
271 virtual ~YACSSchemaPage();
273 virtual bool validatePage();
274 virtual int nextId() const ;
275 virtual void cleanupPage() {}
279 void choose_env_file();
282 QLineEdit * _yacs_file_text;
283 QLineEdit * _line_env_file;
286 class CommandMainPage: public QWizardPage
291 CommandMainPage(QWidget * parent);
292 virtual ~CommandMainPage();
294 virtual bool validatePage();
295 virtual int nextId() const ;
296 virtual void cleanupPage() {}
299 void choose_command_file();
300 void choose_env_file();
303 QLineEdit * _line_command;
304 QLineEdit * _line_env_file;
307 class PythonSalomeMainPage: public QWizardPage
312 PythonSalomeMainPage(QWidget * parent);
313 virtual ~PythonSalomeMainPage();
315 virtual bool validatePage();
316 virtual int nextId() const ;
317 virtual void cleanupPage() {}
320 void choose_PythonSalome_file();
321 void choose_env_file();
324 QLineEdit * _line_PythonSalome;
325 QLineEdit * _line_env_file;
328 class AdvancedParametersPage: public QWizardPage
333 AdvancedParametersPage(BL::CreateJobWizard * parent);
334 virtual ~AdvancedParametersPage();
336 virtual int nextId() const;
337 virtual void cleanupPage() {}
340 Ui::AdvancedParametersWizardPage * ui;